Demo/Program.cs

24 lines
879 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, SQLGroupRepositoryImpl>()
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
.AddSingleton<UserUseCase>()
.AddSingleton<GroupUseCase>()
.AddSingleton<PresenceUseCase>();
var serviceProvider = services.BuildServiceProvider();
var userUseCase = serviceProvider.GetService<UserUseCase>();
var groupUseCase = serviceProvider.GetService<GroupUseCase>();
var presenceUseCase = serviceProvider.GetService<PresenceUseCase>();
MainMenuUI mainMenuUI = new MainMenuUI(userUseCase, groupUseCase, presenceUseCase);