Ejemplo n.º 1
0
 public IActionResult Get()
 {
     _logger.LogInformation($"{nameof(StyleController)} : {nameof(Get)} was called.");
     try
     {
         var style = _styleService.FindAll();
         if (style == null)
         {
             return(NotFound("Style was not found"));
         }
         return(Ok(style));
     }
     catch (DbException exception)
     {
         _logger.LogError(exception.Message);
         return(BadRequest(exception.Message));
     }
     catch (Exception exception)
     {
         _logger.LogError(exception.Message);
         throw;
     }
 }