123/123/Program.cs
Class_Student db7680b8ec hello
2024-12-04 10:24:43 +03:00

23 lines
794 B
C#

using _123.Data.RemoteData.RemoteDatabase;
using _123.Data.ReportsHistory;
using _123.Data.Repository;
using _123.Domain.UseCase;
using _123.UI;
using Microsoft.Extensions.DependencyInjection;
using System.Text.RegularExpressions;
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>();