Exemplo n.º 1
0
 public async Task <IActionResult> Put(int id, [FromBody] City value)
 {
     try
     {
         return(Ok(await context.Put(id, value)));
     }
     catch (Exception ex)
     {
         return(BadRequest(new ErrorMessage(ex.Message)));
     }
 }
Exemplo n.º 2
0
 public IHttpActionResult Put(int id, [FromBody] city value)
 {
     try
     {
         return(Ok(context.Put(id, value)));
     }
     catch (Exception ex)
     {
         return(Content(HttpStatusCode.NotModified, ex.Message));
     }
 }