Пример #1
0
 public IActionResult Get()
 {
     try
     {
         _logger.LogInformation("Trying to get list of volunteers");
         var volunteers = _volunteersService.Get().ToList();
         _logger.LogInformation($"Search completed. Found {volunteers.Count} volunteers.");
         VolunteersResponse.NumberOfRecordsFound = volunteers.Count;
         VolunteersResponse.Data    = volunteers;
         VolunteersResponse.Message = "Search completed.";
         return(Ok(new[] { VolunteersResponse }));
     }
     catch (Exception ex)
     {
         _logger.LogInformation($"Error: {ex.Message}");
     }
     _logger.LogError("Bad request");
     return(BadRequest());
 }
Пример #2
0
 public Volunteer Get(long id)
 {
     return(volunteerService.Get(id));
 }