Ejemplo n.º 1
0
        public void Handle(MarkInstallmentAsPaid message)
        {
            DomainEvents.Register <InstallmentPaidDomainEvent>(InstallmentPaidDomainEventHandler);
            var installment = _installmentRepository.GetById(message.Id);

            installment.MarkAsPaid();
            _installmentRepository.Flush();
            _bus.Return(ReturnCode.OK);
        }
 public InstallmentDto GetById(Guid id)
 {
     try
     {
         using (var transactionScope = new TransactionScope())
         {
             var installmentDto = new InstallmentDtoMapper().MapWithAccount(_installmentRepository.GetById(id));
             transactionScope.Complete();
             return(installmentDto);
         }
     }
     finally
     {
         _sessionProvider.CloseCurrent();
     }
 }