Demo/Program.cs

20 lines
710 B
C#
Raw Normal View History

2024-10-17 11:46:19 +00:00
using Demo.Data.Repository;
using Demo.Domain.UseCase;
using Demo.UI;
2024-10-21 10:55:18 +00:00
using Microsoft.Extensions.DependencyInjection;
2024-10-17 11:46:19 +00:00
2024-10-21 10:55:18 +00:00
IServiceCollection services = new ServiceCollection();
2024-10-17 11:46:19 +00:00
2024-10-21 10:55:18 +00:00
services
.AddSingleton<IGroupRepository, GroupRepositoryImpl>()
.AddSingleton<IUserRepository, UserRepositoryImpl>()
2024-10-22 18:51:54 +00:00
.AddSingleton<IPresenceRepository, PresenceRepositoryImpl>()
2024-10-21 10:55:18 +00:00
.AddSingleton<IGroupUseCase, GroupUseCase>()
.AddSingleton<IUserUseCase, UserUseCase>()
2024-10-22 18:51:54 +00:00
.AddSingleton<IPresenceUseCase, PresenceUseCase>()
2024-10-21 10:55:18 +00:00
.AddSingleton<UserConsoleUI>()
.AddSingleton<MainMenuUI>();
var serviceProvider = services.BuildServiceProvider();
MainMenuUI? mainMenuUI = serviceProvider.GetService<MainMenuUI>();