public void UpdateCustomer(CustomerModel customerModel) { foreach (CustomerModel custlst in _customerList) { if (custlst.Email == customerModel.Email) { _customerList.Remove(custlst); _customerList.Add(customerModel); break; } } }
public ActionResult Edit(CustomerModel cust) { try { // TODO: Add update logic here _customers.UpdateCustomer(cust); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Create(CustomerModel custModel) { _customers.CreateCustomer(custModel); return RedirectToAction("Index"); }
public void CreateCustomer(CustomerModel customerModel) { _customerList.Add(customerModel); }