public IList <TlProviderAddress> BuildList(TlProvider tlProvider = null) => new List <TlProviderAddress> { new TlProviderAddress { TlProvider = tlProvider ?? new TlProviderBuilder().Build(), DepartmentName = "Exams Office", OrganisationName = "Org name1", AddressLine1 = "Test Line 1", AddressLine2 = "Test Line 2", Town = "Test Town", Postcode = "xx1 1yy", IsActive = true, CreatedBy = Constants.CreatedByUser, CreatedOn = Constants.CreatedOn, ModifiedBy = Constants.ModifiedByUser, ModifiedOn = Constants.ModifiedOn }, new TlProviderAddress { TlProvider = tlProvider ?? new TlProviderBuilder().Build(), DepartmentName = "Test Office", OrganisationName = "Org name2", AddressLine1 = "Line 1", AddressLine2 = "Line 2", Town = "Town", Postcode = "aa5 1tt", IsActive = true, CreatedBy = Constants.CreatedByUser, CreatedOn = Constants.CreatedOn, ModifiedBy = Constants.ModifiedByUser, ModifiedOn = Constants.ModifiedOn } };
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); Specialisms = TlevelDataProvider.CreateTlSpecialisms(DbContext, awardingOrganisation, Pathway); TqAwardingOrganisation = TlevelDataProvider.CreateTqAwardingOrganisation(DbContext, Pathway, TlAwardingOrganisation); TlProvider = ProviderDataProvider.CreateTlProvider(DbContext); TqProvider = ProviderDataProvider.CreateTqProvider(DbContext, TqAwardingOrganisation, TlProvider); AssessmentSeries = AssessmentSeriesDataProvider.CreateAssessmentSeriesList(DbContext, null, true); DbContext.SaveChangesAsync(); }
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 TlProvider CreateTlProvider(ResultsAndCertificationDbContext _dbContext, long ukprn, string name, string displayName, bool addToDbContext = true) { var tlProvider = new TlProvider { UkPrn = ukprn, Name = name, DisplayName = displayName }; if (addToDbContext) { _dbContext.Add(tlProvider); } return(tlProvider); }
public TlProviderAddress Build(TlProvider tlProvider = null) { return(new TlProviderAddress { TlProvider = tlProvider ?? new TlProviderBuilder().Build(), DepartmentName = "Exams Office", OrganisationName = "Org name1", AddressLine1 = "Test Line 1", AddressLine2 = "Test Line 2", Town = "Test Town", Postcode = "xx1 1yy", IsActive = true, CreatedBy = Constants.CreatedByUser, CreatedOn = Constants.CreatedOn, ModifiedBy = Constants.ModifiedByUser, ModifiedOn = Constants.ModifiedOn }); }
protected virtual void SeedProviderData() { TlProvider = ProviderDataProvider.CreateTlProvider(DbContext); }
public static TqProvider CreateTqProvider(ResultsAndCertificationDbContext _dbContext, TqAwardingOrganisation tqAwardingOrganisation, TlProvider tlProvider, bool addToDbContext = true) { if (tlProvider != null && tqAwardingOrganisation != null) { var tqProvider = new TqProvider { TlProviderId = tlProvider.Id, TqAwardingOrganisationId = tqAwardingOrganisation.Id, TqAwardingOrganisation = tqAwardingOrganisation }; if (addToDbContext) { _dbContext.Add(tqProvider); } return(tqProvider); } return(null); }
public static TlProvider CreateTlProvider(ResultsAndCertificationDbContext _dbContext, TlProvider tlProvider, bool addToDbContext = true) { if (tlProvider == null) { tlProvider = new TlProviderBuilder().Build(); } if (addToDbContext) { _dbContext.Add(tlProvider); } return(tlProvider); }
public static IList <TqProvider> CreateTqProviders(ResultsAndCertificationDbContext _dbContext, IList <TqAwardingOrganisation> tqAwardingOrganisations, TlProvider tlProvider, bool addToDbContext = true) { if (tlProvider != null && tqAwardingOrganisations != null && tqAwardingOrganisations.Count > 0) { var tqProviders = new List <TqProvider>(); foreach (var tqAwardingOrganisation in tqAwardingOrganisations) { tqProviders.Add(new TqProvider { TlProviderId = tlProvider.Id, TqAwardingOrganisationId = tqAwardingOrganisation.Id, }); } if (addToDbContext) { _dbContext.AddRange(tqProviders); } return(tqProviders); } return(null); }