Exemple #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);
        }
 public Task <WorkoutDto> GetWorkoutDtoAsync(int id)
 {
     return(_workoutRepo.GetWorkoutDtoAsync(id));
 }