19 lines
737 B
C#
19 lines
737 B
C#
|
using presence.Data.RemoteData.RemoteDatabase;
|
|||
|
using presence.Data.Repository;
|
|||
|
using presence.Domain.UseCase;
|
|||
|
using presence.UI;
|
|||
|
using Microsoft.Extensions.DependencyInjection;
|
|||
|
|
|||
|
IServiceCollection services = new ServiceCollection();
|
|||
|
services
|
|||
|
.AddSingleton<UserUseCase>()
|
|||
|
.AddSingleton<GroupUseCase>()
|
|||
|
.AddSingleton<PresenceUseCase>()
|
|||
|
.AddSingleton<MainMenuUI>()
|
|||
|
.AddDbContext<RemoteDatabaseContext>()
|
|||
|
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
|
|||
|
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
|
|||
|
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>();
|
|||
|
var serviceProvider = services.BuildServiceProvider();
|
|||
|
|
|||
|
var mainMenuUI = serviceProvider.GetRequiredService<MainMenuUI>();
|