Example #1
0
 public IHttpActionResult Read(int id)
 {
     try
     {
         var value = service.Read(id);
         return(Ok(value));
     }
     catch (KeyNotFoundException)
     {
         return(NotFound());
     }
     catch (UnauthorizedAccessException)
     {
         return(StatusCode(HttpStatusCode.Forbidden));
     }
 }