public void Handle(DeleteRatingCommand command) { //Lesson lesson = repo.GetById<Lesson>(command.Id, command.Version); Lesson lesson = repo.GetById <Lesson>(command.Id); lesson.DeleteRating(command.RatingId, command.Date); repo.Save(lesson, Guid.NewGuid()); }
public void ShouldRequireValidTodoItemId() { var command = new DeleteRatingCommand { Id = 99 }; FluentActions.Invoking(() => SendAsync(command)).Should().Throw <NotFoundException>(); }
public async Task <IActionResult> Delete([FromRoute] int ratingId) { var command = new DeleteRatingCommand { RatingId = ratingId, UserId = HttpContext.GetUserId() }; await mediator.Send(command).ConfigureAwait(false); return(NoContent()); }
public void Delete(int userId, int gameId) { var deleteRatingCommand = new DeleteRatingCommand(userId, gameId); _bus.SendCommand(deleteRatingCommand); }