public IEnumerable<Customer> Get() { using (CustomerContext Context = new CustomerContext()) { return Context.Customers.ToList(); } }
public Customer NewCustomer([FromBody] Customer newCustomer) { using (CustomerContext Context = new CustomerContext()) { Context.Customers.Add(newCustomer); Context.SaveChanges(); } return newCustomer; }