public void Handle(AccountSuspended message)
        {
            DomainEvents.Register <AgreementSuspendedDomainEvent>(AgreementSuspendedDomainEventHandler);
            var agreement = _agreementRepository.GetById(message.AgreementId);

            agreement.Suspend();
            _agreementRepository.Flush();
        }
        public void Handle(CancelAgreement message)
        {
            DomainEvents.Register <AgreementCancelledDomainEvent>(AgreementCancelledDomainEventHandler);
            var agreement = _agreementRepository.GetById(message.Id);

            agreement.Cancel();
            _agreementRepository.Flush();
            _bus.Return(ReturnCode.OK);
        }
Exemplo n.º 3
0
 public Agreement GetAgreement(int id)
 {
     return(_agreementRepository.GetById(id));
 }
Exemplo n.º 4
0
 public Task <AgreementResponse> GetById(Guid id) => _agreementRepository.GetById(id);