PIbd-22_Shabunov_O.A._AirBo.../AirBomber/Program.cs
2023-11-26 00:26:38 +04:00

35 lines
979 B
C#

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;
using System;
namespace AirBomber
{
internal static class Program
{
[STAThread]
static void Main()
{
ApplicationConfiguration.Initialize();
var services = new ServiceCollection();
ConfigureServices(services);
using (ServiceProvider ServiceProvider = services.BuildServiceProvider())
{
Application.Run(ServiceProvider.GetRequiredService<FormEntityCollection>());
}
}
private static void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<FormEntityCollection>().AddLogging(
option =>
{
option.SetMinimumLevel(LogLevel.Information);
option.AddNLog("nlog.config");
}
);
}
}
}