public void DeleteCustomer1(int cid) { var rep = new EfCustomerService(context); var customer = rep.GetById(cid); if (customer != null) { if (rep.GetAll().Contains(customer)) { rep.Delete(customer); } } }
public void PostCustomer(Customer customer) { var rep = new EfCustomerService(context); rep.Save(customer); }
public IEnumerable <Customer> GetAllCustomers() { var rep = new EfCustomerService(context); return(rep.GetAll()); }
public Customer GetCustomer(int id) { var rep = new EfCustomerService(context); return(rep.GetById(id)); }