Demo/Program.cs

26 lines
953 B
C#
Raw Normal View History

2024-10-24 15:57:52 +00:00
using Demo.Data.RemoteData.RemoteDataBase;
2024-10-17 11:46:19 +00:00
using Demo.Data.Repository;
using Demo.Domain.UseCase;
using Demo.UI;
2024-10-21 10:55:18 +00:00
using Microsoft.Extensions.DependencyInjection;
2024-10-17 11:46:19 +00:00
2024-10-21 10:55:18 +00:00
IServiceCollection services = new ServiceCollection();
2024-10-17 11:46:19 +00:00
2024-10-21 10:55:18 +00:00
services
2024-10-24 15:57:52 +00:00
.AddDbContext<RemoteDatabaseContext>()
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
2024-10-30 06:35:19 +00:00
.AddSingleton<IAdminRepository, SQLAdminRepositoryImpl>()
2024-10-21 10:55:18 +00:00
.AddSingleton<IGroupUseCase, GroupUseCase>()
.AddSingleton<IUserUseCase, UserUseCase>()
2024-10-22 18:51:54 +00:00
.AddSingleton<IPresenceUseCase, PresenceUseCase>()
2024-10-30 06:35:19 +00:00
.AddSingleton<IAdminUseCase, AdminUseCase>()
2024-10-21 10:55:18 +00:00
.AddSingleton<UserConsoleUI>()
2024-10-30 06:35:19 +00:00
.AddSingleton<AdminConsoleUI>()
2024-10-21 10:55:18 +00:00
.AddSingleton<MainMenuUI>();
var serviceProvider = services.BuildServiceProvider();
MainMenuUI? mainMenuUI = serviceProvider.GetService<MainMenuUI>();