presence/console_ui/Program.cs

29 lines
1.0 KiB
C#
Raw Normal View History

2024-11-01 19:07:13 +00:00
using Demo.Data.RemoteData.RemoteDataBase;
using Demo.Data.Repository;
using Demo.Domain.UseCase;
using Demo.UI;
using Microsoft.Extensions.DependencyInjection;
IServiceCollection services = new ServiceCollection();
services
.AddDbContext<RemoteDatabaseContext>()
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
.AddSingleton<IAdminRepository, SQLAdminRepositoryImpl>()
.AddSingleton<IGroupUseCase, GroupUseCase>()
.AddSingleton<IUserUseCase, UserUseCase>()
.AddSingleton<IPresenceUseCase, PresenceUseCase>()
.AddSingleton<IAdminUseCase, AdminUseCase>()
.AddSingleton<UserConsoleUI>()
2024-11-29 07:41:36 +00:00
.AddSingleton<GroupConsoleUI>()
.AddSingleton<PresenceConsoleUI>()
2024-11-01 19:07:13 +00:00
.AddSingleton<AdminConsoleUI>()
.AddSingleton<MainMenuUI>();
var serviceProvider = services.BuildServiceProvider();
MainMenuUI? mainMenuUI = serviceProvider.GetService<MainMenuUI>();