ISEbd-21_Agliullov.D.A._Con.../Confectionery/Program.cs
Данияр Аглиуллов 310f02160b 1 раз
2024-02-02 11:10:52 +04:00

41 lines
1.5 KiB
C#

using EkzamenBusinessLogic;
using EkzamenContracts.BusinessLogicsContracts;
using EkzamenContracts.StoragesContract;
using EkzamenListImplement;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;
namespace EkzamenView
{
internal static class Program
{
private static ServiceProvider? _serviceProvider;
public static ServiceProvider? ServiceProvider => _serviceProvider;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPIsettings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
var services = new ServiceCollection();
ConfigureServices(services);
_serviceProvider = services.BuildServiceProvider();
}
private static void ConfigureServices(ServiceCollection services)
{
services.AddLogging(option =>
{
option.SetMinimumLevel(LogLevel.Information);
option.AddNLog("nlog.config");
});
services.AddTransient<IStudentStorage, StudentStorage>();
services.AddTransient<IGroupStorage, GroupStorage>();
services.AddTransient<IStudentLogic, StudentLogic>();
services.AddTransient<IGroupLogic, GroupLogic>();
}
}
}