コード例 #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.CopyQueryPropertiesTo(ret);
            return(ret);
        }
コード例 #2
0
        public static CqlUpdate Update <TSource>(this CqlQuery <TSource> source)
        {
            var ret = new CqlUpdate(source.Expression, source.Provider);

            source.CopyQueryPropertiesTo(ret);
            return(ret);
        }
コード例 #3
0
        /// <summary>
        /// Returns a representation of a UPDATE ... IF EXISTS cql statement, for Lightweight Transactions support.
        /// </summary>
        public static CqlConditionalCommand <TSource> UpdateIfExists <TSource>(this CqlQuery <TSource> source)
        {
            var update = new CqlUpdate(Expression.Call(null, CqlMthHelps.UpdateIfExistsMi, source.Expression),
                                       source.Table, source.StatementFactory, source.PocoData, source.MapperFactory);

            source.CopyQueryPropertiesTo(update);
            return(new CqlConditionalCommand <TSource>(update, source.MapperFactory));
        }
コード例 #4
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.CopyQueryPropertiesTo(update);
            return(new CqlConditionalCommand <TSource>(update, source.MapperFactory));
        }
コード例 #5
0
        public static CqlUpdate UpdateIf <TSource>(this CqlQuery <TSource> source, Expression <Func <TSource, bool> > predicate)
        {
            var ret = new CqlUpdate(Expression.Call(
                                        null, CqlMthHelps.UpdateIfMi,
                                        new[] { source.Expression, predicate }), source.Provider);

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