Ejemplo n.º 1
0
 public IActionResult Get(int id)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             return(BadRequest(ModelState));         // 400
         }
         return(Ok(_blockService.GetByIdBlock(id))); //200
     }
     catch (Exception ex)
     {
         return(StatusCode(500, new
         {
             Result = false,
             ErrorMessage = ex.Message
         }));
     }
 }