public static IHost InitializeDataBase(this IHost host) { var serviceScopeFactory = host.Services; using var scope = serviceScopeFactory.CreateScope(); var services = scope.ServiceProvider; TheosBookStoreStockDbContext stockDB = services .GetRequiredService <TheosBookStoreStockDbContext>(); stockDB.Database.Migrate(); TheosBookStoreAuthDbContext authDB = services .GetRequiredService <TheosBookStoreAuthDbContext>(); authDB.Database.Migrate(); return(host); }
public UserRepository(TheosBookStoreAuthDbContext dbContext, IMapper mapper) : base(dbContext, mapper) { }