public async Task <ActionResult <Models.Customer> > PostCustomer(Models.Customer customer) { _context.Customers.Add(customer); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetCustomer), new { id = customer.Id }, customer)); }
public async Task <ActionResult <Customer> > AddCustomerAsync([FromBody] Customer customer) { _context.Customers.Add(customer); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetCustomerAsync), new { id = customer.Id }, customer)); }