public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); app.UseStatusCodePages(); if (Envirnoment.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseStaticFiles(); app.UseMvc(); }
public void ConfigureServices(IServiceCollection services) { if (Envirnoment.IsDevelopment()) { services.AddDbContext <TDLContext>(options => options.UseInMemoryDatabase()); services.AddTransient <IShowService, InMemoryShowService>(); } else { services.AddDbContext <TDLContext>(options => options.UseSqlite("Filename=./TDL.db")); services.AddTransient <IShowService, SqLiteShowService>(); } services.Configure <AppSettings>(options => Configuration.GetSection("AppSettings").Bind(options)); services .AddMvcCore() .AddViews() .AddRazorViewEngine() .AddRazorPages(); }