Demo/Program.cs
2024-10-23 10:06:56 +03:00

19 lines
671 B
C#

using Posechaemost.Data.Repository;
using Posechaemost.Domain.UseCase;
using Posechaemost.UI;
using Microsoft.Extensions.DependencyInjection;
using System.Text.RegularExpressions;
IServiceCollection services = new ServiceCollection();
services
.AddSingleton<IGroupRepository, GroupRepositoryImpl>()
.AddSingleton<UserUseCase>();
var serviceProvider = services.BuildServiceProvider();
GroupRepositoryImpl groupRepositoryImpl = new GroupRepositoryImpl();
UserUseCase userUseCase = serviceProvider.GetService<UserUseCase>();
GroupUseCase groupUseCase = new GroupUseCase(groupRepositoryImpl);
MainMenuUI mainMenuUI = new MainMenuUI(userUseCase, groupUseCase);