private async Task CreatePostRateAsync(Domain.Primary.Entities.PostRate postRate, CancellationToken cancellationToken) { await _context.PostRate.AddAsync(postRate, cancellationToken) .ConfigureAwait(false); await _context.SaveChangesAsync(cancellationToken) .ConfigureAwait(false); }
public async Task <Guid> Handle(AddRateToPostCommand request, CancellationToken cancellationToken) { await _userStorage.ThrowIfDoesNotExistAsync(request.UserId) .ConfigureAwait(false); Domain.Primary.Entities.PostRate postRate = ConvertToPostRate(request); await CreatePostRateAsync(postRate, cancellationToken) .ConfigureAwait(false); return(postRate.PostRateId); }