Demo/Program.cs

26 lines
969 B
C#
Raw Normal View History

using Posechaemost.Data.Repository;
using Posechaemost.Domain.UseCase;
using Posechaemost.UI;
2024-10-23 07:06:56 +00:00
using Microsoft.Extensions.DependencyInjection;
using System.Text.RegularExpressions;
2024-11-11 20:02:21 +00:00
using Posechaemost.Data.RemoteData.RemoteDataBase;
2024-10-23 07:06:56 +00:00
IServiceCollection services = new ServiceCollection();
services
2024-11-11 20:02:21 +00:00
.AddDbContext<RemoteDataBaseContext>()
2024-11-06 04:10:09 +00:00
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
.AddSingleton<UserUseCase>()
.AddSingleton<GroupUseCase>()
2024-11-11 20:02:21 +00:00
.AddSingleton<PresenceUseCase>()
.AddSingleton<PresenceConsoleUI>()
.AddSingleton<MainMenuUI>();
2024-10-23 07:06:56 +00:00
var serviceProvider = services.BuildServiceProvider();
2024-11-11 20:02:21 +00:00
// Создаем пользовательский интерфейс
MainMenuUI mainMenuUI = serviceProvider.GetService<MainMenuUI>();
2024-11-11 20:02:21 +00:00
// Выводим главное меню
mainMenuUI.DisplayMenu();