Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public UserRepository(TheosBookStoreAuthDbContext dbContext, IMapper mapper)
     : base(dbContext, mapper)
 {
 }