Exemplo n.º 1
0
        public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));

            app.UseStatusCodePages();

            if (Envirnoment.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseStaticFiles();

            app.UseMvc();
        }
Exemplo n.º 2
0
        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();
        }