This commit is contained in:
2025-01-12 19:46:35 -06:00
parent 2e1a3b0dcc
commit 53c8c0700a
-2
View File
@@ -75,8 +75,6 @@ app.MapDelete("/inventory/{id}", async (int id, BarkContext db) =>
return Results.Ok(new { Message = "Inventory item deleted successfully" }); return Results.Ok(new { Message = "Inventory item deleted successfully" });
}); });
app.Services.GetRequiredService<BarkContext>().Database.Migrate();
using (var serviceScope = app.Services.CreateScope()) using (var serviceScope = app.Services.CreateScope())
{ {
var dbContext = serviceScope.ServiceProvider.GetRequiredService<BarkContext>(); var dbContext = serviceScope.ServiceProvider.GetRequiredService<BarkContext>();