예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        public IEnumerable <Customer> GetAllCustomers()
        {
            var rep = new EfCustomerService(context);

            return(rep.GetAll());
        }