Esempio n. 1
0
        protected override string CqlString()
        {
            var visitor = new CqlExpressionVisitor();

            visitor.Evaluate(Expression);
            return(visitor.GetCount());
        }
Esempio n. 2
0
        public new Task <TEntity> ExecuteAsync()
        {
            bool withValues = GetTable().GetSession().BinaryProtocolVersion > 1;

            var visitor = new CqlExpressionVisitor();

            visitor.Evaluate(Expression);

            object[] values;
            string   cql = visitor.GetCount(out values, withValues);

            var adaptation =
                InternalExecuteAsync(cql, values).ContinueWith((t) =>
            {
                var rs     = t.Result;
                var result = default(TEntity);
                var row    = rs.FirstOrDefault();
                if (row != null)
                {
                    result = (TEntity)row[0];
                }
                return(result);
            }, TaskContinuationOptions.ExecuteSynchronously);

            return(adaptation);
        }
Esempio n. 3
0
        protected override string GetCql(out object[] values)
        {
            var visitor = new CqlExpressionVisitor();

            visitor.Evaluate(Expression);
            return(visitor.GetCount(out values));
        }
        protected override string GetCql(out object[] values)
        {
            var visitor = new CqlExpressionVisitor(PocoData, Table.Name, Table.KeyspaceName);

            visitor.Evaluate(Expression);
            return(visitor.GetCount(out values));
        }
Esempio n. 5
0
        public override IAsyncResult BeginExecute(AsyncCallback callback, object state)
        {
            var visitor = new CqlExpressionVisitor();

            visitor.Evaluate(Expression);

            return(InternalBeginExecute(visitor.GetCount(), visitor.Mappings, visitor.Alter, callback, state));
        }
Esempio n. 6
0
        public override string ToString()
        {
            var visitor = new CqlExpressionVisitor();

            visitor.Evaluate(Expression);
            object[] _;
            return(visitor.GetCount(out _, false));
        }
Esempio n. 7
0
        public override IAsyncResult BeginExecute(AsyncCallback callback, object state)
        {
            bool withValues = GetTable().GetSession().BinaryProtocolVersion > 1;

            var visitor = new CqlExpressionVisitor();

            visitor.Evaluate(Expression);

            object[] values;
            string   cql = visitor.GetCount(out values, withValues);

            return(InternalBeginExecute(cql, values, visitor.Mappings, visitor.Alter, callback, state));
        }