예제 #1
0
        /// <summary>
        /// Returns a representation of a UPDATE cql statement
        /// </summary>
        public static CqlUpdate Update <TSource>(this CqlQuery <TSource> source)
        {
            var ret = new CqlUpdate(source.Expression, source.Table, source.StatementFactory, source.PocoData, source.MapperFactory);

            source.CopyQueryPropertiesTo(ret);
            return(ret);
        }
예제 #2
0
        /// <summary>
        /// Returns a representation of a UPDATE ... IF ... cql statement, for Lightweight Transactions support
        /// </summary>
        public static CqlConditionalCommand <TSource> UpdateIf <TSource>(this CqlQuery <TSource> source, Expression <Func <TSource, bool> > predicate)
        {
            var update = new CqlUpdate(Expression.Call(
                                           null, CqlMthHelps.UpdateIfMi,
                                           new[] { source.Expression, predicate }), source.Table, source.StatementFactory, source.PocoData, source.MapperFactory);

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