public MainViewModel(MainWindow w) { MainWindow = w; Instance = this; FacultyDbContext context = new FacultyDbContext(); GroupsRepository = new Repository <Group>(context); SpecsRepository = new Repository <Spec>(context); StudentsRepository = new Repository <Student>(context); OpenGroupsPageCommand = new RelayCommand(() => CurrentPage = new GroupsPage()); OpenSpecsPageCommand = new RelayCommand(() => CurrentPage = new SpecsPage()); }
public Repository(FacultyDbContext cntxt) { context = cntxt; dbSet = context.Set <T>(); }