using Microsoft.EntityFrameworkCore; using PhoneToolMX.Data; var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllersWithViews(); builder.Services.AddDbContext( options => options.UseNpgsql(builder.Configuration.GetConnectionString("DbConnection"), b => b.MigrationsAssembly("PhoneToolMX.Models"))); builder.Services.AddDatabaseDeveloperPageExceptionFilter(); if (!builder.Environment.IsDevelopment()) { builder.Host.UseSystemd(); } var app = builder.Build(); // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.MapControllerRoute( name: "default", pattern: "{action}", defaults: new { controller = "Config" }); app.Run();