public static void Main() { SeedStudentData seed = new SeedStudentData(); seed.Seed(new StudentSystemContext()); using (var db = new StudentSystemContext()) { db.Database.Migrate(); } }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.UseDeveloperExceptionPage(); app.UseStatusCodePages(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute("Default", "", new { Controller = "User", action = "Index" }); endpoints.MapDefaultControllerRoute(); endpoints.MapRazorPages(); } ); IdentitySeedData.EnsurePopulated(app); SeedStudentData.EnsurePopulated(app); SeedSubjectData.EnsurePopulated(app); SeedStudentsSubjectData.EnsurePopulated(app); SeedProtocolData.EnsurePopulated(app); }