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(); }
public IActionResult DeleteExercise([FromBody] DeleteExerciseCommand command) { _commandsBus.Send(command); return(NoContent()); }
public async Task <ActionResult> Delete( [FromRoute] DeleteExerciseCommand command) => await this.Send(command);