Exemple #1
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 #2
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
         });
     }
 }