예제 #1
0
 public IEnumerable <Customer> GetAll()
 {
     using (var dbContext = new CustomDbContext())
     {
         return(dbContext.Customers.ToList());
     }
 }
예제 #2
0
 public void Create(Customer customer)
 {
     using (var dbContext = new CustomDbContext())
     {
         dbContext.Customers.Add(customer);
         dbContext.SaveChanges();
     }
 }