public async Task <int> CreateWorkout(WorkoutBody workoutBody)
        {
            // create workout exercises
            List <WorkoutExercise> exercises = new List <WorkoutExercise>();

            foreach (int exerciseId in workoutBody.Exercises)
            {
                // if the exercise does not exist
                if (!await exerciseRepository.ExerciseExists(exerciseId))
                {
                    continue;
                }

                exercises.Add(new WorkoutExercise
                {
                    ExerciseId = exerciseId
                });
            }

            // create new workout
            Workout newWorkout = new Workout
            {
                Name      = workoutBody.Name,
                Type      = workoutBody.Type,
                Exercises = exercises
            };

            // save workout to database
            await workoutRepository.CreateAsync(newWorkout);

            return(newWorkout.Id);
        }