Ejemplo n.º 1
0
        public async Task Handle(AddContractLine command, CancellationToken cancellationToken)
        {
            var contract = await _repository.GetByIdAsync(command.ContractId, cancellationToken);

            contract.AddContractLine(command.Product, command.Price, command.Quantity);
            await _repository.SaveAsync(contract, cancellationToken);
        }
Ejemplo n.º 2
0
 public Task Post([FromBody] AddContractLine command, CancellationToken cancellationToken)
 {
     return(_messageBusPublisher.PublishAsync(command, cancellationToken));
 }