Ejemplo n.º 1
0
 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));
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
 public OrganisationsDataRetrievalService(IOrganisationsContext organisations, ICache <IMessage> messageCache)
     : base(messageCache)
 {
     _organisations = organisations;
 }
Ejemplo n.º 5
0
 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));
        }
Ejemplo n.º 8
0
        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));
        }
Ejemplo n.º 9
0
        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));
        }