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; } } }
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); }
public Banco AddBanco(Banco Banco) { var ResultadoEntity = _bancoRepository.Add(BancoMapper.Map(Banco)); return(BancoMapper.Map(ResultadoEntity)); }