예제 #1
0
		// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
		public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, BlogContextDataSeed dataSeed)
		{
			loggerFactory.AddConsole(Configuration.GetSection("Logging"));
			loggerFactory.AddDebug();

			app.UseIdentity();

			//app.UseIISPlatformHandler();

			if (env.IsDevelopment())
				app.UseDeveloperExceptionPage();

			app.UseCookieAuthentication(options =>
			{
				options.LoginPath = new PathString("/Auth/Login");
			});

			app.UseStaticFiles();

			app.UseMvc(config =>
			{
				config.MapRoute(
					name: "Default",
					template: "{controller}/{action}/{id?}",
					defaults: new {controller = "App", action = "Index"});
			});

			_dataStartup.Configure(app, dataSeed);
		}
예제 #2
0
		public async void Configure(IApplicationBuilder app, BlogContextDataSeed dataSeed)
		{
			//app.UseIdentity();

			await dataSeed.EnsureSeedData();
		}