public FileValidationController( IFcsContext fcsContext, IOrganisationsContext organisationsContext, ILogger logger) { _fcsContext = fcsContext; _organisationsContext = organisationsContext; _logger = logger; }
private async Task <Dictionary <long, List <OrganisationCampusIdentifier> > > BuildCampusIdentifiersDictionary( Dictionary <long, Dictionary <string, List <OrganisationCampusIdSpecialistResource> > > specResourcesForUkprnDictionary, IOrganisationsContext context, CancellationToken cancellationToken) { var campusIdentifiers = await context .CampusIdentifiers? .Select(ci => BuildCampusIdentifiers(ci, specResourcesForUkprnDictionary)) .ToListAsync(cancellationToken); return(BuildCampusIdentifiersDictionary(campusIdentifiers)); }
private async Task <Dictionary <long, Dictionary <string, List <OrganisationCampusIdSpecialistResource> > > > BuildCampusIdSpecResourceDictionary( List <long> ukprns, IOrganisationsContext context, CancellationToken cancellationToken) { var campusIdentifierSpecResources = await context.CampusIdentifierSpecResources .Where(c => ukprns.Contains(c.MasterUkprn)) .Select(x => new CampusIdentifierSpecResource() { MasterUkprn = x.MasterUkprn, CampusIdentifier = x.CampusIdentifier.ToUpperCase(), EffectiveFrom = x.EffectiveFrom, EffectiveTo = x.EffectiveTo, SpecialistResources = x.SpecialistResources }) .ToListAsync(cancellationToken); return(BuildCampusIdSpecResourceDictionary(campusIdentifierSpecResources)); }
public OrganisationsDataRetrievalService(IOrganisationsContext organisations, ICache <IMessage> messageCache) : base(messageCache) { _organisations = organisations; }
private OrganisationsDataRetrievalService NewService(IOrganisationsContext organisations = null, ICache <IMessage> messageCache = null) { return(new OrganisationsDataRetrievalService(organisations, messageCache)); }
private async Task <Dictionary <long, List <OrganisationShortTermFundingInitiative> > > BuildShortTermFundingInitiativesDictionary(IOrganisationsContext context, CancellationToken cancellationToken) { var stfis = await context.ShortTermFundingInitiatives.ToListAsync(cancellationToken); return(BuildShortTermFundingInitiativesDictionary(stfis)); }
private async Task <Dictionary <long, List <OrganisationPostcodeSpecialistResource> > > BuildPostcodeSpecResDictionary(IOrganisationsContext context, CancellationToken cancellationToken) { var specResources = await context.ProviderPostcodeSpecialistResources.ToListAsync(cancellationToken); return(BuildPostcodeSpecResDictionary(specResources)); }
private async Task <Dictionary <long, List <OrganisationShortTermFundingInitiative> > > BuildShortTermFundingInitiativesDictionary(List <long> ukprns, IOrganisationsContext context, CancellationToken cancellationToken) { var shortTermFundingInitiatives = await context.ShortTermFundingInitiatives.Where(c => ukprns.Contains(c.Ukprn)).ToListAsync(cancellationToken); return(BuildShortTermFundingInitiativesDictionary(shortTermFundingInitiatives)); }
private async Task <Dictionary <long, List <OrganisationPostcodeSpecialistResource> > > BuildPostcodeSpecResDictionary(List <long> ukprns, IOrganisationsContext context, CancellationToken cancellationToken) { var specResources = await context.ProviderPostcodeSpecialistResources.Where(c => ukprns.Contains(c.Ukprn)).ToListAsync(cancellationToken); return(BuildPostcodeSpecResDictionary(specResources)); }