public async Task <IHttpActionResult> UpdateAsync(CustomerContract customer) { try { await customerService.UpdateAsync(customer.ToModel()); return(Content(HttpStatusCode.Accepted, customer.CustomerId)); } catch (KeyNotFoundException) { return(NotFound()); } }
public async Task <IHttpActionResult> AddAsync(CustomerContract customer) { await customerService.AddAsync(customer.ToModel()); return(Created(new Uri(Request.RequestUri, customer.CustomerId.ToString()), customer.CustomerId)); }