Beispiel #1
0
        public void InternalHaving(Expression exp)
        {
            var sql    = _comonExp.ExpressionWhereLambda(null, exp, this, null, null);
            var method = _select.GetType().GetMethod("Having", new[] { typeof(string), typeof(object) });

            method.Invoke(_select, new object[] { sql, null });
        }
        public ISelectGrouping <TKey, TValue> Having(Expression <Func <ISelectGroupingAggregate <TKey, TValue>, bool> > exp)
        {
            var sql    = _comonExp.ExpressionWhereLambda(null, exp, getSelectGroupingMapString);
            var method = _select.GetType().GetMethod("Having", new[] { typeof(string), typeof(object) });

            method.Invoke(_select, new object[] { sql, null });
            return(this);
        }
        public ISelectedQuery <TOut> OrderByIf <TMember>(bool condition, Expression <Func <TOut, TMember> > column, bool descending = false)
        {
            if (condition == false)
            {
                return(this);
            }
            var sql    = _comonExp.ExpressionWhereLambda(null, column, this, null, null);
            var method = _select.GetType().GetMethod("OrderBy", new[] { typeof(string), typeof(object) });

            method.Invoke(_select, new object[] { descending ? $"{sql} DESC" : sql, null });
            return(this);
        }