private async Task CreateSpecialisms(ResultsAndCertificationDbContext context)
        {
            await context.TlSpecialism.AddRangeAsync(new List <TlSpecialism>
            {
                new TlSpecialism {
                    Id = 1, Name = "Surveying and design for construction and the built environment", TlPathwayId = 1, CreatedBy = "Sys", CreatedOn = DateTime.UtcNow
                },
                new TlSpecialism {
                    Id = 2, Name = "Civil Engineering", TlPathwayId = 1, CreatedBy = "Sys", CreatedOn = DateTime.UtcNow
                },
                new TlSpecialism {
                    Id = 3, Name = "Building services design", TlPathwayId = 1, CreatedBy = "Sys", CreatedOn = DateTime.UtcNow
                },
                new TlSpecialism {
                    Id = 4, Name = "Hazardous materials analysis and surveying", TlPathwayId = 1, CreatedBy = "Sys", CreatedOn = DateTime.UtcNow
                },
                new TlSpecialism {
                    Id = 5, Name = "Early years education and childcare", TlPathwayId = 2, CreatedBy = "Sys", CreatedOn = DateTime.UtcNow
                },
                new TlSpecialism {
                    Id = 6, Name = "Assisting teaching", TlPathwayId = 2, CreatedBy = "Sys", CreatedOn = DateTime.UtcNow
                },
                new TlSpecialism {
                    Id = 7, Name = "Supporting and mentoring students in further and higher education", TlPathwayId = 2, CreatedBy = "Sys", CreatedOn = DateTime.UtcNow
                },
                new TlSpecialism {
                    Id = 8, Name = "Digital Production, Design and Development", TlPathwayId = 3, CreatedBy = "Sys", CreatedOn = DateTime.UtcNow
                },
            });

            await context.SaveChangesAsync();
        }
        public virtual async Task <int> CreateAsync(T entity)
        {
            await _dbContext.AddAsync(entity);

            try
            {
                await _dbContext.SaveChangesAsync();
            }
            catch (DbUpdateException due)
            {
                _logger.LogError(due.Message, due.InnerException);
                throw;
            }

            return(entity.Id);
        }
        private async Task CreateProviders(ResultsAndCertificationDbContext context)
        {
            await context.TqProvider.AddRangeAsync(new List <TqProvider>
            {
                new TqProvider {
                    TqAwardingOrganisationId = 1, TlProviderId = 1, CreatedBy = "System", CreatedOn = DateTime.UtcNow
                },
            });

            await context.SaveChangesAsync();
        }
        private async Task CreateTwoAwardOrganisations(ResultsAndCertificationDbContext context)
        {
            await context.TqAwardingOrganisation.AddRangeAsync(new List <TqAwardingOrganisation>
            {
                new TqAwardingOrganisation {
                    Name = "AO1", DisplayName = "Award Org1", UkAon = "test1", CreatedBy = "Sys", CreatedOn = DateTime.UtcNow
                },
                new TqAwardingOrganisation {
                    Name = "AO2", DisplayName = "Award Org2", UkAon = "test2", CreatedBy = "Sys", CreatedOn = DateTime.UtcNow
                },
            });

            await context.SaveChangesAsync();
        }
        private async Task CreateTwoProviders(ResultsAndCertificationDbContext context)
        {
            await context.TlProvider.AddRangeAsync(new List <TlProvider>
            {
                new TlProvider {
                    Name = "P1", DisplayName = "Provider1", UkPrn = 111, CreatedBy = "sys", CreatedOn = DateTime.UtcNow
                },
                new TlProvider {
                    Name = "P2", DisplayName = "Provider2", UkPrn = 111, CreatedBy = "sys", CreatedOn = DateTime.UtcNow
                },
                // TODO: which process will set the flag - IsTlevelProvider..
            });

            await context.SaveChangesAsync();
        }