Ejemplo n.º 1
0
 public IActionResult Get()
 {
     try
     {
         _logger.LogInformation("All the rebels");
         return(Ok(_rebelService.GetRebels()));
     }
     catch (Exception ex)
     {
         _logger.LogError($"Failed getting the rebels from our system {ex}");
     }
     return(BadRequest("Failed getting the rebels"));
 }
Ejemplo n.º 2
0
 public ActionResult <IEnumerable <Rebel> > GetRebels()
 {
     _log.LogInformation("Init GetRebels");
     try
     {
         var rebels = _rebelService.GetRebels();
         _log.LogInformation("GetRebels Request resolved successfully");
         return(Ok(rebels));
     }
     catch (Exception e)
     {
         _log.LogError("Exception trying to GetRebels: " + e.Message);
         return(BadRequest(e.Message));
     }
 }