Exemplo n.º 1
0
        public async Task Handle(ContractValidated @event, CancellationToken cancellationToken)
        {
            var contract = await _contractReadModelRepository.GetByIdAsync(@event.ContractId, cancellationToken);

            //if(e == null)
            //    throw new Exception("Could not find entity in readModel");

            if (contract != null)
            {
                contract.IsValidated = true;
                contract.Version     = contract.Version + 1;
                await _contractReadModelRepository.SaveChangesAsync(cancellationToken);
            }
        }
Exemplo n.º 2
0
        public async Task Handle(ContractValidated message)
        {
            Data.ContractValidated = true;

            Log.Information($"ContractId {message.ContractId} validated!");

            await _bus.Send(new SendContractCopyByEmail()
            {
                ProposalId = Data.ProposalId,
                Name       = Data.CustomerName,
                Email      = Data.CustomerEmail,
                ContractId = message.ContractId
            });

            TryComplete();
        }
Exemplo n.º 3
0
 private void Apply(ContractValidated e)
 {
     this.IsValidated = true;
 }