Пример #1
0
        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());
        }
Пример #2
0
 public Repository(FacultyDbContext cntxt)
 {
     context = cntxt;
     dbSet   = context.Set <T>();
 }