コード例 #1
0
            private async Task CreateCommentRateAsync(Domain.Primary.Entities.CommentRate commentRate, CancellationToken cancellationToken)
            {
                await _context.CommentRate.AddAsync(commentRate, cancellationToken)
                .ConfigureAwait(false);

                await _context.SaveChangesAsync(cancellationToken)
                .ConfigureAwait(false);
            }
コード例 #2
0
            public async Task <Guid> Handle(AddRateToCommentCommand request, CancellationToken cancellationToken)
            {
                await _userStorage.ThrowIfDoesNotExistAsync(request.UserId)
                .ConfigureAwait(false);

                Domain.Primary.Entities.CommentRate commentRate = ConvertToCommentRate(request);

                await CreateCommentRateAsync(commentRate, cancellationToken)
                .ConfigureAwait(false);

                return(commentRate.CommentRateId);
            }