public static void ClearTestData(CoursesDataContext context)
 {
     context.Standards.RemoveRange(context.Standards.ToList());
     context.SectorSubjectAreaTier2.RemoveRange(context.SectorSubjectAreaTier2.ToList());
     context.Frameworks.RemoveRange(context.Frameworks.ToList());
     context.SaveChanges();
 }
 public static void LoadTestData(CoursesDataContext context)
 {
     context.Routes.AddRange(GetTestRoutes().ToList());
     context.SectorSubjectAreaTier2.AddRange(GetSectorSubjectAreaTier2Items());
     context.Standards.AddRange(GetValidTestStandards());
     context.Standards.AddRange(GetInValidTestStandards());
     context.Standards.AddRange(GetNotYetApprovedTestStandards());
     context.Standards.AddRange(GetOlderVersionsOfStandards());
     context.Standards.AddRange(GetWithdrawnStandards());
     context.Frameworks.AddRange(GetFrameworks());
     context.SaveChanges();
 }
Exemplo n.º 3
0
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, CoursesDataContext dbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            dbContext.Database.Migrate();

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseCors(builder => builder
                        .AllowAnyOrigin()
                        .AllowAnyMethod()
                        .AllowAnyHeader());
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            app.UseSwaggerReDoc();
        }
Exemplo n.º 4
0
 public BaseBOLCourseUsers(params int[] MCodes)
 {
     MasterCode  = Convert.ToInt32(MCodes[0]);
     dataContext = new CoursesDataContext();
 }
Exemplo n.º 5
0
 public BaseBOLCourses()
 {
     dataContext = new CoursesDataContext();
 }