using AsbCloudApp.Services; using AsbCloudDb.Model; using AsbCloudInfrastructure.Services.Cache; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using System; namespace AsbCloudInfrastructure { public class Startup { public static void BeforeRunHandler(IHost host, IConfigurationRoot configuration) { using var scope = host.Services.CreateScope(); var context = scope.ServiceProvider.GetService(); context.Database.SetCommandTimeout(TimeSpan.FromSeconds(2 * 60)); context.Database.Migrate(); var wellService = scope.ServiceProvider.GetService(); wellService.EnshureTimezonesIsSet(); } } }