public List <Customer> GetAllCustomers() { using (var context = new HandsOnExamContext()) { return(context.Customers.ToList()); } }
public Customer GetCustomerById(int customerId) { using (var context = new HandsOnExamContext()) { return(context.Customers.Find(customerId)); } }
public Customer EditCustomer(Customer Customer) { using (var context = new HandsOnExamContext()) { context.Entry(Customer).State = EntityState.Modified; context.SaveChanges(); return(Customer); } }