public async Task <IList <EmployeeDiseaseRiskStatus> > MapEmployeesDiseaseRiskStatusAsync(Guid clientId,
                                                                                                  IList <EmployeeDiseaseRiskStatusRecord> employeeDiseaseRiskStatusRiskStatusRecords)
        {
            var clientDiseaseRiskTask = _clientSettingsProvider.GetByClientIdAsync(clientId);
            var diseaseRisksTask      = _diseaseRiskProvider.GetAllAsync();
            var lookupTask            = _lookupsProvider.GetAsync();
            await Task.WhenAll(clientDiseaseRiskTask, diseaseRisksTask, lookupTask).ConfigureAwait(false);

            return(GetEmployeeDiseaseRiskStatuses(
                       clientDiseaseRiskTask.Result,
                       diseaseRisksTask.Result,
                       lookupTask.Result,
                       _mapper,
                       employeeDiseaseRiskStatusRiskStatusRecords));
        }
示例#2
0
        public async Task <IHttpActionResult> GetAsync()
        {
            var lookups = await _lookupsProvider.GetAsync();

            if (lookups == null)
            {
                return(NotFound());
            }
            return(Ok(lookups));
        }
示例#3
0
 public async Task <Lookups> GetAsync()
 {
     return(await _cacheService.GetOrSetAsync(CacheKeys.Lookups, async() => await _lookupsProvider.GetAsync()));
 }