Beispiel #1
0
        public void DeleteExercise(DeleteExerciseCommand command)
        {
            var exercise = this.context.Exercises
                           .Include(e => e.BodyPartsUsed)
                           .Single(e => e.ExerciseId == command.Id);

            this.context.Exercises.Remove(exercise);
            this.context.SaveChanges();
        }
Beispiel #2
0
        public IActionResult DeleteExercise([FromBody] DeleteExerciseCommand command)
        {
            _commandsBus.Send(command);

            return(NoContent());
        }
Beispiel #3
0
 public async Task <ActionResult> Delete(
     [FromRoute] DeleteExerciseCommand command)
 => await this.Send(command);