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() .AddSingleton() .AddSingleton() .AddSingleton() .AddDbContext() .AddSingleton() .AddSingleton() .AddSingleton(); var serviceProvider = services.BuildServiceProvider(); var mainMenuUI = serviceProvider.GetRequiredService();