20 lines
710 B
C#
20 lines
710 B
C#
using Demo.Data.Repository;
|
|
using Demo.Domain.UseCase;
|
|
using Demo.UI;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
IServiceCollection services = new ServiceCollection();
|
|
|
|
services
|
|
.AddSingleton<IGroupRepository, GroupRepositoryImpl>()
|
|
.AddSingleton<IUserRepository, UserRepositoryImpl>()
|
|
.AddSingleton<IPresenceRepository, PresenceRepositoryImpl>()
|
|
.AddSingleton<IGroupUseCase, GroupUseCase>()
|
|
.AddSingleton<IUserUseCase, UserUseCase>()
|
|
.AddSingleton<IPresenceUseCase, PresenceUseCase>()
|
|
.AddSingleton<UserConsoleUI>()
|
|
.AddSingleton<MainMenuUI>();
|
|
|
|
var serviceProvider = services.BuildServiceProvider();
|
|
|
|
MainMenuUI? mainMenuUI = serviceProvider.GetService<MainMenuUI>(); |