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); }
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); }