public ActionResult Edit(string id, FormCollection collection)
 {
     var customerRepository = new CustomerRepository(new Context());
     Customer customer = customerRepository.Read(id);
     UpdateModel(customer);
     try
     {
         customerRepository.Update(customer);
         return RedirectToAction("Details", new {id = id});
     }
     catch (Exception ex)
     {
         ModelState.AddModelError(string.Empty, ex.Message);
     }
     return View(customer);
 }
 public ActionResult Search(string companyName, string contactName, string contactTitle)
 {
     var customers = new Customer[0];
     try
     {
         customers = new CustomerRepository(new Context()).Search(companyName, contactName, contactTitle);
     }
     catch (Exception ex)
     {
         ModelState.AddModelError(string.Empty, ex.Message);
     }
     return PartialView("SearchPartial", customers);
 }
 //
 // GET: /Customer/Edit/5
 public ActionResult Edit(string id)
 {
     Customer customer = new CustomerRepository(new Context()).Read(id);
     return View(customer);
 }