0
0
MyDarling/Program.cs
2023-02-16 07:23:48 +03:00

23 lines
648 B
C#

using Microsoft.EntityFrameworkCore;
using MyDarling.Models;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDbContext<DataContext>(opts =>
{
opts.UseSqlite(builder.Configuration["ConnectionStrings:MyDarlingDb"]);
opts.EnableSensitiveDataLogging(true);
});
builder.Services.AddSingleton<IRepository, MyDarlingRepository>();
builder.Services.AddControllersWithViews();
var app = builder.Build();
app.UseStaticFiles();
app.MapControllers();
app.MapDefaultControllerRoute();
// var context = app.Services.CreateScope().ServiceProvider.GetRequiredService<DataContext>();
// SeedData.SeedDatabase(context);
app.Run();