protected override void Seed(EvotingContext context) { ConsituencySeed.Seed(context); VoterSeed.Seed(context); AdminSeed.Seed(context); PartySeed.Seed(context); CandidateSeed.Seed(context); ConfigSeed.Seed(context); }
public static void Main(string[] args) { var host = CreateWebHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) { var services = scope.ServiceProvider; AdminSeed.Initialize(services); } host.Run(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, AdminSeed adminSeed) { adminSeed.Initialize(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseMiniProfiler(); } else { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseSession(); app.UseCookiePolicy(); app.UseNToastNotify(); app.UseAuthentication(); app.UseMvc(); }