forked from ddrilling/AsbCloudServer
4db67113b4
CrudCacheService Адаптировано для новой схемы кеширования. Убраны extention методы для mapster.
26 lines
858 B
C#
26 lines
858 B
C#
using AsbCloudApp.Services;
|
|
using AsbCloudDb.Model;
|
|
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<IAsbCloudDbContext>();
|
|
context.Database.SetCommandTimeout(TimeSpan.FromSeconds(2 * 60));
|
|
|
|
context.Database.Migrate();
|
|
|
|
var wellService = scope.ServiceProvider.GetService<IWellService>();
|
|
wellService.EnshureTimezonesIsSetAsync(System.Threading.CancellationToken.None).Wait();
|
|
}
|
|
}
|
|
}
|