0
0
MyDarling/Program.cs
2023-03-02 07:28:22 +03:00

23 lines
576 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.AddControllersWithViews();
var app = builder.Build();
app.UseStaticFiles();
app.MapControllers();
app.MapDefaultControllerRoute();
// var context = app.Services.CreateScope().ServiceProvider.GetRequiredService<DataContext>();
// SeedData.SeedDatabase(context);
app.Run();