public int Cadastrar(EmpresaVaga entity)
        {
            try
            {
                const string query =
                    @"INSERT INTO EmpresaVaga (IdEmpresa, IdVaga) 
                        VALUES (:IdEmpresa, :IdVaga)";

                var parametros = new
                {
                    entity.IdEmpresa,
                    entity.IdVaga
                };

                string sequenceName = null;

                if (DataBaseType == DataBaseType.Oracle)
                {
                    sequenceName = SequenceHelper.GetSequenceName <EmpresaVaga>(entity);
                }

                return(Convert.ToInt32(IDbConn.CommandInsert(query, DataBaseType, parametros, sequenceName: sequenceName)));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public int Cadastrar(EmpresaVaga entity)
        {
            using (var scope = new TransactionScope())
            {
                var result = _repository.Cadastrar(entity);

                if (result <= 0)
                {
                    throw new Exception("Ocorreu um erro ao cadastrar");
                }

                scope.Complete();
                return(result);
            }
        }