using EFlib; using EFManager; using Microsoft.EntityFrameworkCore; using Model; using StubLib; var builder = WebApplication.CreateBuilder(args); var connectionString = builder.Configuration.GetConnectionString("SQLiteContext"); builder.Services.AddDbContext(options => options.UseSqlite(connectionString), ServiceLifetime.Singleton); builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddSingleton(); builder.Services.AddScoped(); // builder.Services.AddScoped(); var app = builder.Build(); app?.Services?.GetService()?.Database.EnsureCreated(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers(); app.Run();