Exemple #1
0
 public Int32 Create(BANCO item, LOG log)
 {
     using (DbContextTransaction transaction = Db.Database.BeginTransaction(IsolationLevel.ReadCommitted))
     {
         try
         {
             _logRepository.Add(log);
             _baseRepository.Add(item);
             transaction.Commit();
             return(0);
         }
         catch (Exception ex)
         {
             transaction.Rollback();
             throw ex;
         }
     }
 }
Exemple #2
0
        public Task <CommandResult> Handle(AddBancoCommand command, CancellationToken cancellationToken)
        {
            if (!command.IsValid())
            {
                NotifyCommandErrors(command);
                return(Response());
            }

            Banco banco = new Banco(command.Nome, command.CodigoCompensacao);

            _bancoRepository.Add(banco);

            if (Commit())
            {
                _mediator.Publish(new AddedBancoEvent());
            }

            return(Response());
        }
 public void Adicionar(Banco banco)
 {
     _bancoRepository.Add(banco);
 }
Exemple #4
0
        public Banco AddBanco(Banco Banco)
        {
            var ResultadoEntity = _bancoRepository.Add(BancoMapper.Map(Banco));

            return(BancoMapper.Map(ResultadoEntity));
        }