public async Task <IHttpActionResult> UpdateAsync(ExampleContract example) { try { await exampleService.UpdateAsync(example.ToModel()); return(Content(HttpStatusCode.Accepted, example.Id)); } catch (KeyNotFoundException) { return(NotFound()); } }
public async Task <IHttpActionResult> AddAsync(ExampleContract example) { await exampleService.AddAsync(example.ToModel()); return(Created(new Uri(Request.RequestUri, example.Id.ToString()), example.Id)); }