Пример #1
0
        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());
        }
Пример #2
0
        public void ShouldRequireValidTodoItemId()
        {
            var command = new DeleteRatingCommand {
                Id = 99
            };

            FluentActions.Invoking(() =>
                                   SendAsync(command)).Should().Throw <NotFoundException>();
        }
Пример #3
0
        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());
        }
Пример #4
0
        public void Delete(int userId, int gameId)
        {
            var deleteRatingCommand = new DeleteRatingCommand(userId, gameId);

            _bus.SendCommand(deleteRatingCommand);
        }