summaryrefslogtreecommitdiff
path: root/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Program.cs')
-rw-r--r--Program.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/Program.cs b/Program.cs
index 8f6a7b7..91c4c5d 100644
--- a/Program.cs
+++ b/Program.cs
@@ -1,9 +1,22 @@
+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>();
+
+
app.Run(); \ No newline at end of file