private List <StudyGroupSimpleItemDto> MapStudyGroups(List <StudyGroupAcademicSubject> studyGroupAcademicSubjects) { var studyGroupDtos = new List <StudyGroupSimpleItemDto>(); if (!studyGroupAcademicSubjects.IsNullOrEmpty()) { var studyGroups = studyGroupAcademicSubjects.Select(select => select.StudyGroup); foreach (var studyGroup in studyGroups) { var studyGroupDto = new StudyGroupSimpleItemDto(); studyGroupDto.Name = studyGroup.Name; studyGroupDto.Id = studyGroup.Id; studyGroupDtos.Add(studyGroupDto); } } return(studyGroupDtos); }
private List <StudyGroupSimpleItemDto> MapStudyGroups(List <TeacherStudyGroup> teacherStudyGroups) { var studyGroupDtos = new List <StudyGroupSimpleItemDto>(); if (!teacherStudyGroups.IsNullOrEmpty()) { var studyGroups = teacherStudyGroups.Select(teacherStudyGroup => teacherStudyGroup.StudyGroup); foreach (var studyGroup in studyGroups) { var studyGroupDto = new StudyGroupSimpleItemDto(); studyGroupDto.Name = studyGroup.Name; studyGroupDto.Id = studyGroup.Id; studyGroupDtos.Add(studyGroupDto); } } return(studyGroupDtos); }
public CreateHomeWorkViewModel() { Input = new CreateHomeWorkInput(); Subject = new AcademicSubjectSimpleItemDto(); StudyGroup = new StudyGroupSimpleItemDto(); }