Exemplo n.º 1
0
        private async Task <ClassViewModel> GetClassViewModelAsync(int id)
        {
            var item = await GetByIdAsync(id);

            var lecturer = await _lecturerApi.GetByIdAsync(item.LecturerId);

            var groupNames = new List <string>();

            foreach (var groupId in item.GroupIds)
            {
                groupNames.Add(await GetGroupName(groupId));
            }

            var viewModel = new ClassViewModel
            {
                Class        = item,
                GroupNames   = groupNames,
                LecturerName = $"{lecturer.FirstName} {lecturer.LastName}",
                SubjectName  = await GetSubjectName(item.SubjectId),
            };

            return(viewModel);
        }
Exemplo n.º 2
0
 public async Task <Lecturer> GetByIdAsync(int id) => await _lecturerApi.GetByIdAsync(id);