Demo/Program.cs

24 lines
879 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;
IServiceCollection services = new ServiceCollection();
services
2024-11-06 04:10:09 +00:00
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
.AddSingleton<UserUseCase>()
.AddSingleton<GroupUseCase>()
.AddSingleton<PresenceUseCase>();
2024-10-23 07:06:56 +00:00
var serviceProvider = services.BuildServiceProvider();
2024-11-06 04:10:09 +00:00
var userUseCase = serviceProvider.GetService<UserUseCase>();
var groupUseCase = serviceProvider.GetService<GroupUseCase>();
var presenceUseCase = serviceProvider.GetService<PresenceUseCase>();
2024-11-06 04:10:09 +00:00
MainMenuUI mainMenuUI = new MainMenuUI(userUseCase, groupUseCase, presenceUseCase);