summaryrefslogtreecommitdiff
path: root/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Program.cs')
-rw-r--r--Program.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/Program.cs b/Program.cs
index 7a4bd1d..2d52ee9 100644
--- a/Program.cs
+++ b/Program.cs
@@ -3,11 +3,12 @@ using MyDarling.Models;
var builder = WebApplication.CreateBuilder(args);
-builder.Services.AddDbContext<DataContext>(opts =>
+builder.Services.AddDbContext<DataContext>(opts =>
{
- opts.UseSqlite(builder.Configuration["ConnectionStrings:MyDarlingDb"]);
- opts.EnableSensitiveDataLogging(true);
+ opts.UseSqlite(builder.Configuration["ConnectionStrings:MyDarlingDb"]);
+ opts.EnableSensitiveDataLogging(true);
});
+builder.Services.AddSingleton<IRepository, MyDarlingRepository>();
builder.Services.AddControllersWithViews();
var app = builder.Build();
@@ -16,7 +17,7 @@ app.UseStaticFiles();
app.MapControllers();
app.MapDefaultControllerRoute();
-var context = app.Services.CreateScope().ServiceProvider.GetRequiredService<DataContext>();
-SeedData.SeedDatabase(context);
+// var context = app.Services.CreateScope().ServiceProvider.GetRequiredService<DataContext>();
+// SeedData.SeedDatabase(context);
app.Run(); \ No newline at end of file