public FluentRecordBase() { var webHost = new WebHostBuilder() .ConfigureAppConfiguration((host, config) => { config.SetBasePath(Directory.GetCurrentDirectory()); config.AddJsonFile("appsettings.json"); if (host.HostingEnvironment.IsDevelopment()) { config.AddUserSecrets <Startup>(); } }) .UseKestrel() .ConfigureLogging((app, logging) => { logging.AddConfiguration(app.Configuration.GetSection("Logging")); logging.AddConsole(); logging.AddDebug(); logging.AddEventSourceLogger(); }) .UseStartup <Startup>().Build(); webHost.CreateOrMigrateDatabase().GetAwaiter().GetResult(); var serviceScope = webHost.Services.CreateScope(); container = serviceScope.ServiceProvider; ClientTimeZoneInfo = TimeZoneInfo .FindSystemTimeZoneById(serviceScope.ServiceProvider.GetRequiredService <ITenantService>().GetCurrentTenant().Timezone); }