Exemplo n.º 1
0
 /// <summary>
 ///     Mapea un objeto Cycle en un objeto CycleEntity
 ///     incluyendo los cursos
 /// </summary>
 /// <param name="cycle"></param>
 /// <returns></returns>
 public static CycleEntity Map(Cycle cycle)
 {
     return(new CycleEntity()
     {
         Id = cycle.Id,
         Name = cycle.Name,
         CourseEntities = cycle.Courses.Select(c => new CourseEntity
         {
             Year = c.Year
         }).ToList(),
         ShiftId = cycle.Shift.Id,
         ShiftEntity = ShiftMapper.Map(cycle.Shift)
     });
 }
Exemplo n.º 2
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)
         });
     }
 }