public static async Task Main(string[] args)
        {
            var webHost = CreateWebHostBuilder(args).Build();

            using (var scope = webHost.Services.CreateScope())
            {
#if (!DEBUG)
                var configuration = scope.ServiceProvider.GetService <IConfiguration>();
                if (Convert.ToInt32(configuration["IsMigrationEnabled"]) != 0)
                {
                    HealthyWayOfLifeDbContext healthyWayOfLifeDbContext = scope.ServiceProvider.GetService <HealthyWayOfLifeDbContext>();
                    healthyWayOfLifeDbContext.GetService <IMigrator>().Migrate();
                }
#endif

                IConfigurationRepository configurationRepository = scope.ServiceProvider.GetService <IConfigurationRepository>();
                GlobalConfig             globalConfig            = scope.ServiceProvider.GetService <GlobalConfig>();

                globalConfig.ConfigurationList = await configurationRepository.GetConfigurationList().ConfigureAwait(false);
            }

            await webHost.RunAsync();
        }
 public BiometryRepository(HealthyWayOfLifeDbContext context)
 {
     _context = context;
 }
Exemple #3
0
 public UserRepository(HealthyWayOfLifeDbContext context, GlobalConfig globalConfig)
 {
     _context      = context;
     _globalConfig = globalConfig;
 }
 public SeedRepository(HealthyWayOfLifeDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemple #5
0
 public ConfigurationRepository(HealthyWayOfLifeDbContext context)
 {
     _context = context;
 }
 public UserSessionRepository(HealthyWayOfLifeDbContext context)
 {
     _context = context;
 }