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); } } }