PresenceApp/console_ui/Program.cs

29 lines
911 B
C#
Raw Normal View History

2024-12-01 16:16:14 +00:00
using data.RemoteData.RemoteDataBase;
using data.Repository;
using data.Domain.UseCase;
using Microsoft.Extensions.DependencyInjection;
using ui;
// Создаем экземпляр репозиториев
IServiceCollection services = new ServiceCollection();
services
.AddDbContext<RemoteDatabaseContext>()
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
.AddSingleton<UserUseCase>()
.AddSingleton<GroupUseCase>()
2024-12-04 23:32:04 +00:00
.AddSingleton<PresenceService>()
2024-12-01 16:16:14 +00:00
.AddSingleton<MainMenuUI>();
var serviceProvider = services.BuildServiceProvider();
// Создаем пользовательский интерфейс
MainMenuUI mainMenuUI = serviceProvider.GetService<MainMenuUI>();
// Выводим главное меню
mainMenuUI.DisplayMenu();