Demo/Program.cs

21 lines
624 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>()
.AddSingleton<IGroupUseCase, GroupUseCase>()
.AddSingleton<IUserUseCase, UserUseCase>()
.AddSingleton<UserConsoleUI>()
.AddSingleton<GroupConsoleUI>()
.AddSingleton<MainMenuUI>();
var serviceProvider = services.BuildServiceProvider();
MainMenuUI mainMenuUI = serviceProvider.GetService<MainMenuUI>();