public static TeachingUnit Convert(DbTeachingUnit dbTeachingUnit)
        {
            if (dbTeachingUnit == null)
            {
                return(null);
            }

            return(new TeachingUnit()
            {
                Id = dbTeachingUnit.Id,
                CountInPeriodTimeslot = dbTeachingUnit.CountInPeriodTimeslot,

                GroupId = dbTeachingUnit.GroupId,
                Group = GroupConverter.Convert(dbTeachingUnit.Group),

                TeacherId = dbTeachingUnit.TeacherId,
                Teacher = TeacherConverter.Convert(dbTeachingUnit.Teacher),

                CourseId = dbTeachingUnit.CourseId,
                Course = CourseConverter.Convert(dbTeachingUnit.Course),

                LessonTypeId = dbTeachingUnit.LessonTypeId,
                LessonType = LessonTypeConverter.Convert(dbTeachingUnit.LessonType),

                ClassroomTypes = dbTeachingUnit.TeachingUnitClassroomTypes
                                 .Select(x => ClassroomTypeConverter.Convert(x.ClassroomType))
                                 .ToList()
            });
        }
        public static Group Convert(DbGroup dbGroup)
        {
            if (dbGroup == null)
            {
                return(null);
            }

            return(new Group()
            {
                Id = dbGroup.Id,
                Name = dbGroup.Name,
                CoursesNumber = dbGroup.CoursesNumber,
                StudentsCount = dbGroup.StudentsCount,

                DepartmentId = dbGroup.DepartmentId,
                Department = DepartmentConverter.Convert(dbGroup.Department),

                ParentGroupId = dbGroup.ParentGroupId,

                ChildGroups = dbGroup.ChildGroups
                              .Select(x => GroupConverter.Convert(x))
                              .ToList()
            });
        }