2024-10-16 20:15:49 +00:00
|
|
|
|
2024-10-24 20:41:31 +00:00
|
|
|
using Data.RemoteData.RemoteDataBase.DAO;
|
2024-10-16 20:15:49 +00:00
|
|
|
using Demo.Data.Repository;
|
|
|
|
using Demo.Domain.UseCase;
|
|
|
|
using Demo.UI;
|
2024-10-21 10:38:39 +00:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2024-10-16 20:15:49 +00:00
|
|
|
|
2024-10-21 10:38:39 +00:00
|
|
|
IServiceCollection services = new ServiceCollection();
|
2024-10-16 20:15:49 +00:00
|
|
|
|
2024-10-21 10:38:39 +00:00
|
|
|
services
|
2024-10-24 20:41:31 +00:00
|
|
|
.AddDbContext<RemoteDatabaseContext>()
|
|
|
|
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
|
|
|
|
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
|
|
|
|
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
|
2024-10-21 10:38:39 +00:00
|
|
|
.AddSingleton<IGroupUseCase, GroupUseCase>()
|
|
|
|
.AddSingleton<IUserUseCase, UserUseCase>()
|
2024-10-23 19:46:46 +00:00
|
|
|
.AddSingleton<IPresenceUseCase, PresenceUseCase>()
|
2024-10-21 10:38:39 +00:00
|
|
|
.AddSingleton<UserConsoleUI>()
|
|
|
|
.AddSingleton<MainMenuUI>();
|
|
|
|
|
|
|
|
var serviceProvider = services.BuildServiceProvider();
|
|
|
|
|
2024-10-24 20:41:31 +00:00
|
|
|
MainMenuUI? mainMenuUI = serviceProvider.GetService<MainMenuUI>();
|