Пример #1
0
        protected override async Task Handle(CreateUserBookActionCommand request, CancellationToken cancellationToken)
        {
            var action = new Core.Models.UserBookAction
            {
                Type = request.Type,
                Time = DateTime.Now,
                Book = await _bookRepository.Find(request.BookId, cancellationToken),
                User = await _userRepository.Find(request.UserId, cancellationToken),
            };

            await _userBookActionRepository.Add(action, cancellationToken);
        }