forked from amkovkov/GranuSightSoftware2
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using GSS2.Core;
|
|
using GSS2.Core.Analysis.AmineContent.Database;
|
|
|
|
namespace GSS2.Test;
|
|
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
var builder = Host.CreateApplicationBuilder(args);
|
|
|
|
builder.Services.AddAmineContentCalibrationContext(builder.Configuration);
|
|
builder.Services.AddAmineContentResultsContext(builder.Configuration);
|
|
|
|
builder.Services.AddLightsService("Hardware:Lights");
|
|
builder.Services.AddTemperatureHumidityService("Hardware:TemperatureHumidity");
|
|
builder.Services.AddIlluminatorService("Hardware:Illuminator");
|
|
builder.Services.AddCameraService("Hardware:Camera");
|
|
|
|
builder.Services.AddHostedService<Worker>();
|
|
|
|
var host = builder.Build();
|
|
|
|
using (var scope = host.Services.CreateScope())
|
|
{
|
|
var context = scope.ServiceProvider.GetRequiredService<AmineContentCalibrationContext>();
|
|
context.Database.Migrate();
|
|
}
|
|
using (var scope = host.Services.CreateScope())
|
|
{
|
|
var context = scope.ServiceProvider.GetRequiredService<AmineContentResultsContext>();
|
|
context.Database.Migrate();
|
|
}
|
|
|
|
host.Run();
|
|
}
|
|
}
|