/// <summary> /// Actualiza un ciclo /// </summary> /// <param name="cycle"> /// El objeto Cycle con los nuevos datos del ciclo /// </param> /// <returns> /// Retorna true /// </returns> public async Task <bool> Update(Cycle cycle) { CycleEntity cycleEntity = CycleMapper.Map(cycle); bool result = await _cycleRepository.Update(cycleEntity); return(result); }
/// <summary> /// Crea un nuevo ciclo formativo /// </summary> /// <param name="cycle"> /// EL objeto Cycle que contiene los datos sobre el ciclo /// </param> /// <exception cref="GradeNameDuplicateEntryException"> /// Lanza GradeNameDuplicateEntryException /// </exception> /// <returns> /// Retorna el objeto Cycle guardado con su id generado /// </returns> public async Task <Cycle> Save(Cycle cycle)//Throw GradeNameDuplicateEntryException { CycleEntity cycleEntity = CycleMapper.Map(cycle); cycleEntity = await _cycleRepository.Save(cycleEntity); cycleEntity = await _cycleRepository .GetIncludingCoursesAndAssignedSubjects(cycleEntity.Id); cycle = CycleMapper.MapIncludingCourses(cycleEntity); return(cycle); }