Ejemplo n.º 1
0
        public async Task <IEnumerable <ExerciseDto> > GetExerciseDtosForWorkoutAsync(int workoutId,
                                                                                      WorkoutExerciseParams workoutExerciseParams)
        {
            var workout = await _workoutRepo.GetWorkoutDtoAsync(workoutId);

            if (workout == null)
            {
                throw new KeyNotFoundException("Workout doesnt exist");
            }

            if (workoutExerciseParams.Shuffle)
            {
                return(_shuffleService.ShuffleList(workout.Exercises));
            }
            return(workout.Exercises);
        }
Ejemplo n.º 2
0
 public Task <WorkoutDto> GetWorkoutDtoAsync(int id)
 {
     return(_workoutRepo.GetWorkoutDtoAsync(id));
 }