From bc164e17ee4cda8e3046e631adbe7d328bbe748c Mon Sep 17 00:00:00 2001 From: Antoine Jourdain Date: Mon, 1 Apr 2024 14:18:58 +0200 Subject: [PATCH] try --- Project/EntityFramework/API/Program.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Project/EntityFramework/API/Program.cs b/Project/EntityFramework/API/Program.cs index c8d198b..9077059 100644 --- a/Project/EntityFramework/API/Program.cs +++ b/Project/EntityFramework/API/Program.cs @@ -120,4 +120,9 @@ app.UseAuthorization(); app.MapControllers(); +var scope = app.Services.CreateScope(); +var services = scope.ServiceProvider; +var context = services.GetRequiredService(); +context.Database.EnsureCreated(); + app.Run();