Exemplo n.º 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);
        }
        public static CqlUpdate Update <TSource>(this CqlQuery <TSource> source)
        {
            var ret = new CqlUpdate(source.Expression, source.Provider);

            source.CopyQueryPropertiesTo(ret);
            return(ret);
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
        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);
        }