Exemplo n.º 1
0
 public IHttpActionResult Delete(int id)
 {
     try
     {
         service.Delete(id);
         return(StatusCode(HttpStatusCode.NoContent));
     }
     catch (NotSupportedException)
     {
         return(BadRequest());
     }
     catch (UnauthorizedAccessException)
     {
         return(StatusCode(HttpStatusCode.Forbidden));
     }
     catch (KeyNotFoundException)
     {
         return(NotFound());
     }
 }