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);
        }
Example #3
0
 public Agreement GetAgreement(int id)
 {
     return(_agreementRepository.GetById(id));
 }
Example #4
0
 public Task <AgreementResponse> GetById(Guid id) => _agreementRepository.GetById(id);