protected virtual void SeedTestData(EnumAwardingOrganisation awardingOrganisation = EnumAwardingOrganisation.Pearson, bool seedMultipleProviders = false)
 {
     TlAwardingOrganisation = TlevelDataProvider.CreateTlAwardingOrganisation(DbContext, awardingOrganisation);
     Route                  = TlevelDataProvider.CreateTlRoute(DbContext, awardingOrganisation);
     Pathway                = TlevelDataProvider.CreateTlPathway(DbContext, awardingOrganisation, Route);
     Specialism             = TlevelDataProvider.CreateTlSpecialisms(DbContext, awardingOrganisation, Pathway).First();
     TqAwardingOrganisation = TlevelDataProvider.CreateTqAwardingOrganisation(DbContext, Pathway, TlAwardingOrganisation);
     TlProvider             = ProviderDataProvider.CreateTlProvider(DbContext);
     TqProvider             = ProviderDataProvider.CreateTqProvider(DbContext, TqAwardingOrganisation, TlProvider);
     AssessmentSeries       = AssessmentSeriesDataProvider.CreateAssessmentSeriesList(DbContext, null, true);
     TlLookup               = TlLookupDataProvider.CreateTlLookupList(DbContext, null, true);
     DbContext.SaveChangesAsync();
 }
示例#2
0
 protected virtual void SeedTestData(EnumAwardingOrganisation awardingOrganisation = EnumAwardingOrganisation.Pearson, bool seedMultipleProviders = false)
 {
     TlAwardingOrganisation = TlevelDataProvider.CreateTlAwardingOrganisation(DbContext, awardingOrganisation);
     Route                  = TlevelDataProvider.CreateTlRoute(DbContext, awardingOrganisation);
     Pathway                = TlevelDataProvider.CreateTlPathway(DbContext, awardingOrganisation, Route);
     Specialism             = TlevelDataProvider.CreateTlSpecialisms(DbContext, awardingOrganisation, Pathway).First();
     TqAwardingOrganisation = TlevelDataProvider.CreateTqAwardingOrganisation(DbContext, Pathway, TlAwardingOrganisation);
     TlProvider             = ProviderDataProvider.CreateTlProvider(DbContext);
     TqProvider             = ProviderDataProvider.CreateTqProvider(DbContext, TqAwardingOrganisation, TlProvider);
     AssessmentSeries       = AssessmentSeriesDataProvider.CreateAssessmentSeriesList(DbContext, null, true);
     TlLookup               = TlLookupDataProvider.CreateTlLookupList(DbContext, null, true);
     PathwayComponentGrades = TlLookup.Where(x => x.Category.Equals(LookupCategory.PathwayComponentGrade.ToString(), StringComparison.InvariantCultureIgnoreCase)).ToList();
     DbContext.SaveChangesAsync();
 }
        public static TlSpecialism CreateTlSpecialism(ResultsAndCertificationDbContext _dbContext, TlPathway tlPathway, string larId, string name, bool addToDbContext = true)
        {
            if (tlPathway == null)
            {
                return(null);
            }

            var tlSpecialism = new TlSpecialism
            {
                LarId       = larId,
                TlPathwayId = tlPathway.Id,
                Name        = name,
                TlPathway   = tlPathway
            };

            if (addToDbContext)
            {
                _dbContext.Add(tlSpecialism);
            }
            return(tlSpecialism);
        }
        public static TqRegistrationSpecialism CreateTqRegistrationSpecialism(ResultsAndCertificationDbContext _dbContext, TqRegistrationPathway tqRegistrationPathway, TlSpecialism tlSpecialism, bool isOptedin = true, bool addToDbContext = true)
        {
            if (tqRegistrationPathway == null && tlSpecialism == null)
            {
                return(null);
            }

            var tqRegistrationSpecialism = new TqRegistrationSpecialism
            {
                TqRegistrationPathwayId = tqRegistrationPathway.Id,
                TqRegistrationPathway   = tqRegistrationPathway,
                TlSpecialismId          = tlSpecialism.Id,
                TlSpecialism            = tlSpecialism,
                StartDate    = DateTime.UtcNow,
                IsOptedin    = isOptedin,
                IsBulkUpload = true
            };

            if (addToDbContext)
            {
                _dbContext.Add(tqRegistrationSpecialism);
            }
            return(tqRegistrationSpecialism);
        }
 public static TlSpecialism CreateTlSpecialism(ResultsAndCertificationDbContext _dbContext, TlSpecialism tlSpecialism, bool addToDbContext = true)
 {
     if (addToDbContext && tlSpecialism == null)
     {
         _dbContext.Add(tlSpecialism);
     }
     return(tlSpecialism);
 }