Raspisanie/Zurnal/Program.cs
2024-11-11 14:42:39 +03:00

28 lines
798 B
C#

using Zurnal.Data.Repository;
using Zurnal.Date.Repository.SQLRepos;
using Zurnal.Domain.UseCase;
using Zurnal.Presence;
using Zurnal.UI;
class Programka
{
static void Main(string[] args)
{
IServiceCollection services = new ServiceCollection();
services
.AddDbContext<RemoteDateBaseContext>()
.AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
.AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
.AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
.AddSingleton<UserUseCase>()
.AddSingleton<GroupUseCase>()
.AddSingleton<UseCaseGeneratePresence>()
.AddSingleton<MainMenuUI>();
var serviceProvider = services.BuildServiceProvider();
MainMenuUI mainMenuUI = serviceProvider.GetService<MainMenuUI>();
mainMenuUI.DisplayMenu();
}
}