Beispiel #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);
        }
        public static CqlDelete Delete <TSource>(this CqlQuery <TSource> source)
        {
            var ret = new CqlDelete(source.Expression, source.Provider);

            source.CopyQueryPropertiesTo(ret);
            return(ret);
        }
Beispiel #3
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 Expression[] { source.Expression, predicate }), source.Table, source.StatementFactory, source.PocoData);

            source.CopyQueryPropertiesTo(delete);
            return(new CqlConditionalCommand <TSource>(delete, source.MapperFactory));
        }
        public static CqlDelete DeleteIf <TSource>(this CqlQuery <TSource> source, Expression <Func <TSource, bool> > predicate)
        {
            var ret = new CqlDelete(Expression.Call(
                                        null, CqlMthHelps.DeleteIfMi,
                                        new Expression[] { source.Expression, predicate }), source.Provider);

            source.CopyQueryPropertiesTo(ret);
            return(ret);
        }