2024-10-16 20:15:49 +00:00
|
|
|
|
|
|
|
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-16 20:15:49 +00:00
|
|
|
|
2024-10-21 10:38:39 +00:00
|
|
|
IServiceCollection services = new ServiceCollection();
|
2024-10-16 20:15:49 +00:00
|
|
|
|
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>();
|