Exemple #1
0
 /// <summary>
 ///     Mapea un objeto CycleEntity en un objeto Cycle
 ///     incluyendo el turno del ciclo, los cursos y las
 ///     asignaturas del los cursos
 /// </summary>
 /// <param name="cycleEntity"></param>
 /// <returns></returns>
 public static Cycle MapIncludingCourses(CycleEntity cycleEntity)
 {
     if (cycleEntity is null)
     {
         return(null);
     }
     else
     {
         return(new Cycle()
         {
             Id = cycleEntity.Id,
             Name = cycleEntity.Name,
             Courses = cycleEntity.CourseEntities.Select(c => CourseMapper
                                                         .MapIncludingSubjects(c)).ToList(),
             Shift = ShiftMapper.Map(cycleEntity.ShiftEntity)
         });
     }
 }
Exemple #2
0
 /// <summary>
 ///     Mapea un objeto StudentEntity en un objeto Student
 ///     incluyendo el curso cursado por el alumno
 /// </summary>
 /// <param name="studentEntity"></param>
 /// <returns></returns>
 public static Student MapIncludingCourse(StudentEntity studentEntity)
 {
     if (studentEntity is null)
     {
         return(null);
     }
     else
     {
         return(new Student()
         {
             Id = studentEntity.Id,
             Dni = studentEntity.Dni,
             FirstName = studentEntity.FirstName,
             LastName1 = studentEntity.LastName1,
             LastName2 = studentEntity.LastName2,
             Course = CourseMapper.MapIncludingCycle(studentEntity.CourseEntity),
             TotalAbsences = studentEntity.TotalAbsences,
             TotalDelays = studentEntity.TotalDelays
         });
     }
 }
Exemple #3
0
 /// <summary>
 ///     Mapea un objeto StudentEntity en un objeto Student
 ///     incluyendo el curso que cursa y las asignaturas que cursa
 ///     el alumno
 /// </summary>
 /// <param name="studentEntity"></param>
 /// <returns></returns>
 public static Student MapIncludingAssignedCourseAndSubjects(StudentEntity studentEntity)
 {
     if (studentEntity is null)
     {
         return(null);
     }
     else
     {
         return(new Student()
         {
             Id = studentEntity.Id,
             Dni = studentEntity.Dni,
             FirstName = studentEntity.FirstName,
             LastName1 = studentEntity.LastName1,
             LastName2 = studentEntity.LastName2,
             Course = CourseMapper.MapIncludingCycle(studentEntity.CourseEntity),
             Subjects = studentEntity.StudentSubjectEntities
                        .Select(ss => SubjectMapper.Map(ss.SubjectEntity)).ToList(),
             TotalAbsences = studentEntity.TotalAbsences,
             TotalDelays = studentEntity.TotalDelays
         });
     }
 }