presence/console_ui/Program.cs

24 lines
813 B
C#
Raw Normal View History

2024-11-11 09:07:11 +00:00
using data.RemoteData.RemoteDataBase;
using data.Repository;
using domain.UseCase;
using ui;
using Microsoft.Extensions.DependencyInjection;
IServiceCollection services = new ServiceCollection();
services
.AddDbContext<RemoteDatabaseContext>()
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
.AddSingleton<UserUseCase>()
.AddSingleton<GroupUseCase>()
.AddSingleton<UseCaseGeneratePresence>()
.AddSingleton<GroupConsoleUI>()
.AddSingleton<PresenceConsole>()
.AddSingleton<MainMenuUI>();
var serviceProvider = services.BuildServiceProvider();
MainMenuUI mainMenuUI = serviceProvider.GetService<MainMenuUI>();
mainMenuUI.DisplayMenu();