MCPcopy Create free account
hub / github.com/TryCatchLearn/Restore-v2 / InitDb

Method InitDb

API/Data/DbInitializer.cs:10–20  ·  view source on GitHub ↗
(WebApplication app)

Source from the content-addressed store, hash-verified

8public class DbInitializer
9{
10 public static async Task InitDb(WebApplication app)
11 {
12 using var scope = app.Services.CreateScope();
13
14 var context = scope.ServiceProvider.GetRequiredService<StoreContext>()
15 ?? throw new InvalidOperationException("Failed to retrieve store context");
16 var userManager = scope.ServiceProvider.GetRequiredService<UserManager<User>>()
17 ?? throw new InvalidOperationException("Failed to retrieve user manager");
18
19 await SeedData(context, userManager);
20 }
21
22 private static async Task SeedData(StoreContext context, UserManager<User> userManager)
23 {

Callers 1

Program.csFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected