// Метод для заполнения БД тестовыми данными public void PopulateDBWithFakeData(IServiceProvider services) { AppointmentJournalContext context = services.GetRequiredService <AppointmentJournalContext>(); if (!context.Services.Any()) { context.Services.AddRange( Services ); context.WorkDays.AddRange( WorkDays ); context.SaveChanges(); } }
public NavigationMenuViewComponent(IServiceProvider _serviceProvider) { context = _serviceProvider.GetRequiredService <AppointmentJournalContext>(); }