Beispiel #1
0
        private async Task <Dictionary <string, List <LARSAnnualValue> > > BuildLARSAnnualValueDictionary(
            IReadOnlyCollection <LARSLearningDeliveryKey> inputKeys, ILARSContext context, CancellationToken cancellationToken)
        {
            var larsAnnualValuesList = await context.LARS_AnnualValues
                                       .Where(l => inputKeys.Select(lldk => lldk.LearnAimRef).Contains(l.LearnAimRef, StringComparer.OrdinalIgnoreCase))
                                       .Select(la => new LARSAnnualValue
            {
                LearnAimRef     = la.LearnAimRef.ToUpperCase(),
                BasicSkills     = la.BasicSkills,
                BasicSkillsType = la.BasicSkillsType,
                EffectiveFrom   = la.EffectiveFrom,
                EffectiveTo     = la.EffectiveTo,
                FullLevel2EntitlementCategory = la.FullLevel2EntitlementCategory,
                FullLevel3EntitlementCategory = la.FullLevel3EntitlementCategory,
                FullLevel2Percent             = la.FullLevel2Percent,
                FullLevel3Percent             = la.FullLevel3Percent,
            }).ToListAsync(cancellationToken);

            return(larsAnnualValuesList
                   .GroupBy(l => l.LearnAimRef, StringComparer.OrdinalIgnoreCase)
                   .ToDictionary(
                       k => k.Key,
                       v => v.Select(l => l).ToList(),
                       StringComparer.OrdinalIgnoreCase));
        }
Beispiel #2
0
 private async Task <List <LARSLearningDelivery> > BuildLARSLearningDelivieries(
     IReadOnlyCollection <LARSLearningDeliveryKey> inputKeys, ILARSContext context, CancellationToken cancellationToken)
 {
     return(await context.LARS_LearningDeliveries
            .Where(l => inputKeys.Select(lldk => lldk.LearnAimRef).Contains(l.LearnAimRef, StringComparer.OrdinalIgnoreCase))
            .Select(
                ld => new LARSLearningDelivery
     {
         LearnAimRef = ld.LearnAimRef.ToUpperCase(),
         LearnAimRefTitle = ld.LearnAimRefTitle,
         LearnAimRefType = ld.LearnAimRefType,
         LearnAimRefTypeDesc = ld.LearnAimRefTypeNavigation.LearnAimRefTypeDesc,
         LearningDeliveryGenre = ld.LearningDeliveryGenre,
         LearnDirectClassSystemCode1 = ld.LearnDirectClassSystemCode1,
         LearnDirectClassSystemCode2 = ld.LearnDirectClassSystemCode2,
         LearnDirectClassSystemCode3 = ld.LearnDirectClassSystemCode3,
         AwardOrgCode = ld.AwardOrgCode,
         EFACOFType = ld.Efacoftype,
         EffectiveFrom = ld.EffectiveFrom,
         EffectiveTo = ld.EffectiveTo,
         EnglandFEHEStatus = ld.EnglandFehestatus,
         EnglPrscID = ld.EnglPrscId,
         FrameworkCommonComponent = ld.FrameworkCommonComponent,
         GuidedLearningHours = ld.GuidedLearningHours,
         NotionalNVQLevel = ld.NotionalNvqlevel,
         NotionalNVQLevelv2 = ld.NotionalNvqlevelv2,
         RegulatedCreditValue = ld.RegulatedCreditValue,
         SectorSubjectAreaTier1 = ld.SectorSubjectAreaTier1,
         SectorSubjectAreaTier2 = ld.SectorSubjectAreaTier2
     }).ToListAsync(cancellationToken));
 }
Beispiel #3
0
 private async Task <Dictionary <LARSLearningDeliveryKey, LARSFrameworkAim> > BuildLARSFrameworkAimDictionary(
     IReadOnlyCollection <LARSLearningDeliveryKey> inputKeys, ILARSContext context, CancellationToken cancellationToken)
 {
     return(await context.LARS_FrameworkAims
            .Where(l => inputKeys.Select(lldk => lldk.LearnAimRef).Contains(l.LearnAimRef, StringComparer.OrdinalIgnoreCase))
            .GroupBy(ld => new LARSLearningDeliveryKey(ld.LearnAimRef, ld.FworkCode, ld.ProgType, ld.PwayCode))
            .ToDictionaryAsync(
                k => k.Key,
                v => v.Select(fa => new LARSFrameworkAim
     {
         LearnAimRef = fa.LearnAimRef.ToUpper(),
         FrameworkComponentType = fa.FrameworkComponentType,
         EffectiveFrom = fa.EffectiveFrom,
         EffectiveTo = fa.EffectiveTo,
     }).FirstOrDefault()));
 }
Beispiel #4
0
        private async Task <Dictionary <string, List <LARSLearningDeliveryCategory> > > BuildLARSLearningDeliveryCategoryDictionary(
            IReadOnlyCollection <LARSLearningDeliveryKey> inputKeys, ILARSContext context, CancellationToken cancellationToken)
        {
            var larsLearningDeliveryCategoriesList = await context.LARS_LearningDeliveryCategories
                                                     .Where(l => inputKeys.Select(lldk => lldk.LearnAimRef).Contains(l.LearnAimRef, StringComparer.OrdinalIgnoreCase))
                                                     .Select(ldc => new LARSLearningDeliveryCategory
            {
                LearnAimRef   = ldc.LearnAimRef.ToUpperCase(),
                CategoryRef   = ldc.CategoryRef,
                EffectiveFrom = ldc.EffectiveFrom,
                EffectiveTo   = ldc.EffectiveTo,
            }).ToListAsync(cancellationToken);

            return(larsLearningDeliveryCategoriesList
                   .GroupBy(l => l.LearnAimRef, StringComparer.OrdinalIgnoreCase)
                   .ToDictionary(
                       k => k.Key,
                       v => v.Select(l => l).ToList(),
                       StringComparer.OrdinalIgnoreCase));
        }
Beispiel #5
0
        private async Task <Dictionary <string, List <LARSValidity> > > BuildLARSValidityDictionary(
            IReadOnlyCollection <LARSLearningDeliveryKey> inputKeys, ILARSContext context, CancellationToken cancellationToken)
        {
            var larsValiditiesList = await context.LARS_Validities
                                     .Where(l => inputKeys.Select(lldk => lldk.LearnAimRef).Contains(l.LearnAimRef, StringComparer.OrdinalIgnoreCase))
                                     .Select(lv => new LARSValidity
            {
                LearnAimRef      = lv.LearnAimRef.ToUpperCase(),
                EffectiveFrom    = lv.StartDate,
                EffectiveTo      = lv.EndDate,
                LastNewStartDate = lv.LastNewStartDate,
                ValidityCategory = lv.ValidityCategory,
            }).ToListAsync(cancellationToken);

            return(larsValiditiesList
                   .GroupBy(l => l.LearnAimRef, StringComparer.OrdinalIgnoreCase)
                   .ToDictionary(
                       k => k.Key,
                       v => v.Select(l => l).ToList(),
                       StringComparer.OrdinalIgnoreCase));
        }
Beispiel #6
0
        private async Task <Dictionary <string, List <LARSFunding> > > BuildLARSFundingDictionary(
            IReadOnlyCollection <LARSLearningDeliveryKey> inputKeys, ILARSContext context, CancellationToken cancellationToken)
        {
            var larsFundingList = await context.LARS_Fundings
                                  .Where(l => inputKeys.Select(lldk => lldk.LearnAimRef).Contains(l.LearnAimRef, StringComparer.OrdinalIgnoreCase))
                                  .Select(lf => new LARSFunding
            {
                LearnAimRef     = lf.LearnAimRef.ToUpperCase(),
                FundingCategory = lf.FundingCategory,
                EffectiveFrom   = lf.EffectiveFrom,
                EffectiveTo     = lf.EffectiveTo,
                RateUnWeighted  = lf.RateUnWeighted,
                RateWeighted    = lf.RateWeighted,
                WeightingFactor = lf.WeightingFactor,
            }).ToListAsync(cancellationToken);

            return(larsFundingList
                   .GroupBy(l => l.LearnAimRef, StringComparer.OrdinalIgnoreCase)
                   .ToDictionary(
                       k => k.Key,
                       v => v.Select(l => l).ToList(),
                       StringComparer.OrdinalIgnoreCase));
        }
 public ReferenceDataCache(IULNv2Context ulnv2Context, ILARSContext larsContext)
 {
     _ulnv2Context = ulnv2Context;
     _larsContext  = larsContext;
     //Populate();
 }
Beispiel #8
0
 private async Task <Dictionary <decimal, string> > BuildLARSSectorSubjectAreaTier2Dictionary(ILARSContext context, CancellationToken cancellationToken)
 {
     return(await context.LARS_SectorSubjectAreaTier2Lookups.ToDictionaryAsync(
                x => x.SectorSubjectAreaTier2,
                x => x.SectorSubjectAreaTier2Desc,
                cancellationToken));
 }
 private async Task <List <LARSLearningDelivery> > BuildLARSLearningDelvieries(ILARSContext context, CancellationToken cancellationToken)
 {
     return(await context.LARS_LearningDeliveries
            .Select(
                ld => new LARSLearningDelivery
     {
         LearnAimRef = ld.LearnAimRef.ToUpperCase(),
         LearnAimRefTitle = ld.LearnAimRefTitle,
         LearnAimRefType = ld.LearnAimRefType,
         LearningDeliveryGenre = ld.LearningDeliveryGenre,
         LearnDirectClassSystemCode1 = ld.LearnDirectClassSystemCode1,
         LearnDirectClassSystemCode2 = ld.LearnDirectClassSystemCode2,
         LearnDirectClassSystemCode3 = ld.LearnDirectClassSystemCode3,
         AwardOrgCode = ld.AwardOrgCode,
         EFACOFType = ld.Efacoftype,
         EffectiveFrom = ld.EffectiveFrom,
         EffectiveTo = ld.EffectiveTo,
         EnglandFEHEStatus = ld.EnglandFehestatus,
         EnglPrscID = ld.EnglPrscId,
         FrameworkCommonComponent = ld.FrameworkCommonComponent,
         GuidedLearningHours = ld.GuidedLearningHours,
         NotionalNVQLevel = ld.NotionalNvqlevel,
         NotionalNVQLevelv2 = ld.NotionalNvqlevelv2,
         RegulatedCreditValue = ld.RegulatedCreditValue,
         SectorSubjectAreaTier1 = ld.SectorSubjectAreaTier1,
         SectorSubjectAreaTier2 = ld.SectorSubjectAreaTier2
     }).ToListAsync(cancellationToken));
 }