VMTeacherDataListViewModel.cs 646 B

12345678910111213141516171819
  1. using System;
  2. using System.Collections.Generic;
  3. using N11_1.Models;
  4. using ReactiveUI;
  5. using N11_1.ViewModels;
  6. using System.Linq;
  7. using Microsoft.EntityFrameworkCore;
  8. namespace N11_1.ViewModels
  9. {
  10. public class VMTeacherDataListViewModel : ReactiveObject
  11. {
  12. List<TbTeacher> data = MainWindowViewModel.connection.TbTeachers.
  13. Include(tb => tb.IdGenderNavigation).
  14. Include(tb=> tb.TbTeachersCourses).ThenInclude(tb=>tb.IdCoursesNavigation).
  15. Include(tb => tb.TbTeachersLessons).ThenInclude(tb => tb.IdLessonNavigation).ToList();
  16. public List<TbTeacher> Data { get => data; set => this.RaiseAndSetIfChanged(ref data, value); }
  17. }
  18. }