public async Task <IListViewModelResponse <ServiceStatusDetailDto> > GetServiceStatusesAsync(String userName) { Logger?.LogDebug("'{0}' has been invoked", nameof(GetServiceStatusesAsync)); var response = new ListViewModelResponse <ServiceStatusDetailDto>(); try { var user = Repository.GetUser(userName); if (user == null) { Logger?.LogInformation("There isn't data for user '{0}'", userName); return(new ListViewModelResponse <ServiceStatusDetailDto>()); } else { response.Model = await Repository .GetServiceStatuses(userName) .ToListAsync(); Logger?.LogInformation("The service status details for '{0}' user were loaded successfully", userName); } } catch (Exception ex) { response.SetError(Logger, ex); } return(response); }
public async Task <IListViewModelResponse <ServiceWatcherItemDto> > GetActiveServiceWatcherItemsAsync() { Logger?.LogDebug("'{0}' has been invoked", nameof(GetActiveServiceWatcherItemsAsync)); var response = new ListViewModelResponse <ServiceWatcherItemDto>(); try { response.Model = await Repository .GetActiveServiceWatcherItems() .ToListAsync(); Logger?.LogInformation("The service watch items were loaded successfully"); } catch (Exception ex) { response.SetError(Logger, ex); } return(response); }