31 lines
991 B
C#
31 lines
991 B
C#
using data.RemoteData.RemoteDataBase;
|
|
using data.Repository;
|
|
using domain.UseCase;
|
|
using ui;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
// Создаем экземпляр репозиториев
|
|
|
|
IServiceCollection services = new ServiceCollection();
|
|
|
|
services
|
|
.AddDbContext<RemoteDatabaseContext>()
|
|
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
|
|
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
|
|
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
|
|
.AddSingleton<UserUseCase>()
|
|
.AddSingleton<GroupUseCase>()
|
|
.AddSingleton<UseCaseGeneratePresence>()
|
|
.AddSingleton<GroupConsoleUI>()
|
|
.AddSingleton<PresenceConsole>()
|
|
.AddSingleton<MainMenuUI>();
|
|
|
|
|
|
|
|
|
|
var serviceProvider = services.BuildServiceProvider();
|
|
// Создаем пользовательский интерфейс
|
|
MainMenuUI mainMenuUI = serviceProvider.GetService<MainMenuUI>();
|
|
|
|
// Выводим главное меню
|
|
mainMenuUI.DisplayMenu(); |