Pibd-22_Lyakhov_T.I._Simple/StudentProgressRecord/Program.cs
2024-10-28 21:38:22 +04:00

54 lines
1.6 KiB
C#

using StudentProgressRecord.Repositories;
using StudentProgressRecord.RepositoryImp;
using Unity;
using Unity.Lifetime;
namespace StudentProgressRecord
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new University());
}
private static IUnityContainer CreateContainer()
{
var container = new UnityContainer();
container.RegisterType<IDepartmentRepository, DepartmentRepository>
(new TransientLifetimeManager());
container.RegisterType<IFacultyRepository, FacultyRepository>
(new TransientLifetimeManager());
container.RegisterType<IGroupRepository, GroupRepository>
(new TransientLifetimeManager());
container.RegisterType<IStatementRepository, StatementRepository>
(new TransientLifetimeManager());
container.RegisterType<IStudentRepository, StudentRepository>
(new TransientLifetimeManager());
container.RegisterType<ISubjectRepository, SubjectRepository>
(new TransientLifetimeManager());
container.RegisterType<ITeacherRepository, TeacherRepository>
(new TransientLifetimeManager());
return container;
}
}
}