Esempio n. 1
0
        /// <summary>
        /// Evaluates the Linq query, executes asynchronously the cql statement and adapts the results.
        /// </summary>
        public async Task <IEnumerable <TEntity> > ExecuteAsync()
        {
            var visitor = new CqlExpressionVisitor(PocoData, Table.Name, Table.KeyspaceName);

            object[] values;
            var      cql = visitor.GetSelect(Expression, out values);
            var      rs  = await InternalExecuteAsync(cql, values).ConfigureAwait(false);

            return(AdaptResult(cql, rs));
        }
        /// <summary>
        /// Asynchronously executes the query and returns a task of a page of results
        /// </summary>
        public async Task <IPage <TEntity> > ExecutePagedAsync()
        {
            SetAutoPage(false);
            var visitor = new CqlExpressionVisitor(PocoData, Table.Name, Table.KeyspaceName);

            object[] values;
            var      cql = visitor.GetSelect(Expression, out values);
            var      rs  = await InternalExecuteAsync(cql, values).ConfigureAwait(false);

            var mapper = MapperFactory.GetMapper <TEntity>(cql, rs);

            return(new Page <TEntity>(rs.Select(mapper), PagingState, rs.PagingState));
        }
Esempio n. 3
0
        protected internal override string GetCql(out object[] values)
        {
            var visitor = new CqlExpressionVisitor(PocoData, Table.Name, Table.KeyspaceName);

            return(visitor.GetDelete(Expression, out values, _timestamp, _ifExists));
        }
Esempio n. 4
0
        protected override string GetCql(out object[] values)
        {
            var visitor = new CqlExpressionVisitor(PocoData, Table.Name, Table.KeyspaceName);

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

            return(visitor.GetUpdate(Expression, out values, _ttl, _timestamp, _mapperFactory));
        }