示例#1
0
        public async Task OnGetAsync()
        {
            var itm    = (await store.FindALLAsync <Student>()).ToList();
            var itmCls = (await store.FindALLAsync <Class>()).ToList();

            Students = new List <StudentViewModel>();
            Classes  = itmCls;

            Students = itm.Join(itmCls, (arg) => arg.ClassId, (arg) => arg.Id, (arg1, arg2) => new StudentViewModel {
                Class = arg2, Fullname = arg1.Fullname, ClassId = arg1.Id
            }).ToList();
        }
示例#2
0
        public async Task OnGetAsync()
        {
            Classes  = (await store.FindALLAsync <Class>()).ToList();
            Teachers = (await store.FindALLAsync <Teacher>()).ToList();

            var itms = (await store.FindALLAsync <Course>()).ToList();

            Courses = new List <CourseViewModel>();
            itms.ForEach(x => Courses.Add(new CourseViewModel
            {
                Name    = x.Name,
                Class   = Classes.FirstOrDefault(y => y.Id == x.ClassId),
                Teacher = Teachers.FirstOrDefault(y => y.Id == x.TeacherId)
            }));
        }
 public async Task OnGetAsync()
 {
     Courses = (await store.FindALLAsync <Course>()).ToList();
 }
示例#4
0
        public async Task OnGetAsync()
        {
            var items = await store.FindALLAsync <Class>();

            Classes = items.ToList();
        }
示例#5
0
        public async Task OnGetAsync()
        {
            var items = await store.FindALLAsync <Teacher>();

            Teachers = items.ToList();
        }