Example #1
0
        /// <summary>
        /// Returns a representation of a DELETE cql statement
        /// </summary>
        public static CqlDelete Delete <TSource>(this CqlQuery <TSource> source)
        {
            var ret = new CqlDelete(source.Expression, source.Table, source.StatementFactory, source.PocoData);

            source.CopyQueryPropertiesTo(ret);
            return(ret);
        }
Example #2
0
        /// <summary>
        /// Returns a representation of a DELETE ... IF ... cql statement, for Lightweight Transactions support
        /// </summary>
        public static CqlConditionalCommand <TSource> DeleteIf <TSource>(this CqlQuery <TSource> source, Expression <Func <TSource, bool> > predicate)
        {
            var delete = new CqlDelete(Expression.Call(
                                           null, CqlMthHelps.DeleteIfMi,
                                           new [] { source.Expression, predicate }), source.Table, source.StatementFactory, source.PocoData);

            source.CopyQueryPropertiesTo(delete);
            return(new CqlConditionalCommand <TSource>(delete, source.MapperFactory));
        }