30 lines
1.0 KiB
C#
30 lines
1.0 KiB
C#
using data.RemoteData;
|
|
using data.Repository;
|
|
using domain.UseCase;
|
|
using ui;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using ui;
|
|
|
|
IServiceCollection services = new ServiceCollection();
|
|
|
|
services.AddDbContext<RemoteDatabaseContext>();
|
|
|
|
// Добавление репозиториев
|
|
services.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>();
|
|
services.AddSingleton<IUserRepository, SQLUserRepositoryImpl>();
|
|
services.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>();
|
|
|
|
// Добавление бизнес-логики (UseCase)
|
|
services.AddSingleton<UserUseCase>();
|
|
services.AddSingleton<GroupUseCase>();
|
|
services.AddSingleton<UseCaseGeneratePresence>();
|
|
|
|
// Добавление пользовательских интерфейсов
|
|
services.AddSingleton<GroupConsole>();
|
|
services.AddSingleton<PresenceConsole>();
|
|
services.AddSingleton<MainMenuUI>();
|
|
|
|
|
|
var serviceProvider = services.BuildServiceProvider();
|
|
MainMenuUI mainMenuUI = serviceProvider.GetService<MainMenuUI>();
|
|
mainMenuUI.DisplayMenu(); |