示例#1
0
 protected override void Seed(EvotingContext context)
 {
     ConsituencySeed.Seed(context);
     VoterSeed.Seed(context);
     AdminSeed.Seed(context);
     PartySeed.Seed(context);
     CandidateSeed.Seed(context);
     ConfigSeed.Seed(context);
 }
示例#2
0
        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();
        }
示例#3
0
文件: Startup.cs 项目: siandk/eshop
        // 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();
        }