Demo/Program.cs

24 lines
783 B
C#
Raw Normal View History

using Demo.Data.Repository;
using Demo.Domain.UseCase;
using Demo.UI;
2024-10-21 10:38:39 +00:00
using Microsoft.Extensions.DependencyInjection;
2024-10-21 10:38:39 +00:00
IServiceCollection services = new ServiceCollection();
2024-10-21 10:38:39 +00:00
services
.AddSingleton<IGroupRepository, GroupRepositoryImpl>()
.AddSingleton<IUserRepository, UserRepositoryImpl>()
2024-10-23 19:46:46 +00:00
.AddSingleton<IPresenceRepository, PresenceRepositoryImpl>()
2024-10-21 10:38:39 +00:00
.AddSingleton<IGroupUseCase, GroupUseCase>()
.AddSingleton<IUserUseCase, UserUseCase>()
2024-10-23 19:46:46 +00:00
.AddSingleton<IPresenceUseCase, PresenceUseCase>()
2024-10-21 10:38:39 +00:00
.AddSingleton<UserConsoleUI>()
.AddSingleton<GroupConsoleUI>()
2024-10-23 19:46:46 +00:00
.AddSingleton<PresenceConsoleUI>()
2024-10-21 10:38:39 +00:00
.AddSingleton<MainMenuUI>();
var serviceProvider = services.BuildServiceProvider();
MainMenuUI mainMenuUI = serviceProvider.GetService<MainMenuUI>();