Raspisanie/Zurnal/Program.cs
2024-11-11 14:41:12 +03:00

23 lines
718 B
C#

using Data.Repository;
using Zurnal.Data.Repository;
using Zurnal.Domain.UseCase;
using Zurnal.Presence;
using Zurnal.UI;
IServiceCollection services = new ServiceCollection();
services
.AddDbContext<RemoteDateBaseContext>()
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
.AddSingleton<UserUseCase>()
.AddSingleton<GroupUseCase>()
.AddSingleton<UseCaseGeneratePresence>()
.AddSingleton<MainMenuUI>();
var serviceProvider = services.BuildServiceProvider();
MainMenuUI mainMenuUI = serviceProvider.GetService<MainMenuUI>();
mainMenuUI.DisplayMenu();