public static SubmittedHomeWorkDto From(SubmittedHomeWork domainObject)
        {
            var dto = new SubmittedHomeWorkDto();

            dto.Id          = domainObject.Id;
            dto.StudentName = domainObject.StudentName;
            dto.Score       = domainObject.Score;
            return(dto);
        }
        public static HomeWorkAssignmentDto From(HomeWorkAssignment domainObject, bool fullyLoaded)
        {
            var dto = new HomeWorkAssignmentDto();

            dto.Id               = domainObject.Id;
            dto.CreatedAt        = domainObject.CreatedAt;
            dto.RowVersion       = domainObject.RowVersion;
            dto.UpdatedAt        = domainObject.UpdatedAt;
            dto.DueDate          = domainObject.DueDate;
            dto.YearClassDisplay = $"{domainObject.YearClass?.TeacherName} {domainObject.YearClass?.YearClassName}";
            dto.YearClassId      = domainObject.YearClassId;
            if (fullyLoaded)
            {
                dto.HomeWorkAssignmentItems = domainObject.HomeWorkAssignmentItems.Select(s => HomeWorkAssignmentItemDto.From(s)).OrderBy(o => o.Word).ToList();
                dto.SubmittedHomeWorks      = domainObject.SubmittedHomeWorks.Select(s => SubmittedHomeWorkDto.From(s)).OrderBy(o => o.StudentName).ToList();
            }
            else
            {
                dto.firstWord = domainObject.HomeWorkAssignmentItems.OrderBy(o => o.Word).FirstOrDefault()?.Word;
                dto.lastWord  = domainObject.HomeWorkAssignmentItems.OrderByDescending(o => o.Word).FirstOrDefault()?.Word;
                if (dto.firstWord == dto.lastWord)
                {
                    dto.lastWord = null;
                }
                dto.CountSubmissions = domainObject.SubmittedHomeWorks.Count();
            }
            return(dto);
        }