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