Beispiel #1
0
        public static Query CachingRemove(this Query query, params string[] cacheKeys)
        {
            query.AddComponent("cache", new CachingCondition
            {
                Action            = CachingAction.Remove,
                CacheKeysToRemove = cacheKeys
            });

            return(query);
        }
Beispiel #2
0
        public static Query CachingGet(this Query query, string cacheKey)
        {
            query.AddComponent("cache", new CachingCondition
            {
                Action   = CachingAction.Get,
                CacheKey = cacheKey
            });

            return(query);
        }
Beispiel #3
0
        public static Query SetRaw(this Query query, string sql, params object[] bindings)
        {
            if (bindings == null)
            {
                query.AddComponent("update", new RawCondition
                {
                    Expression = sql,
                    Bindings   = bindings
                });
            }
            else
            {
                query.AddComponent("update", new RawCondition
                {
                    Expression = sql,
                    Bindings   = null
                });
            }

            return(query);
        }
Beispiel #4
0
        public static Query Set(this Query query, string column, object value)
        {
            if (Utilities.EqualsIgnoreCase(column, nameof(Entity.Id)) ||
                Utilities.EqualsIgnoreCase(column, nameof(Entity.LastModifiedDate)))
            {
                return(query);
            }

            query.AddComponent("update", new BasicCondition
            {
                Column   = column,
                Operator = "=",
                Value    = value
            });

            return(query);
        }