using Demo.Data.Repository; using Demo.Domain.UseCase; using Demo.UI; using Microsoft.Extensions.DependencyInjection; IServiceCollection services = new ServiceCollection(); services .AddSingleton() .AddSingleton() .AddSingleton() .AddSingleton() .AddSingleton() .AddSingleton(); var serviceProvider = services.BuildServiceProvider(); MainMenuUI? mainMenuUI = serviceProvider.GetService();