Example #1
0
        public DataFilter <TModel> AddCustomOrderExpression(string orderByField, string orderByDirection, Expression <Func <TModel, Object> > expression)
        {
            DataFilterOrderExpression <TModel> expr = new DataFilterOrderExpression <TModel>
            {
                OrderByField     = orderByField,
                OrderByDirection = orderByDirection,
                Expression       = expression
            };

            CustomOrderExpressionList.Add(expr);
            return(this);
        }
Example #2
0
        public DataFilter <TModel> AddCustomOrderExpression(string orderByField, Expression <Func <TModel, Object> > expressionASC, Expression <Func <TModel, Object> > expressionDESC)
        {
            DataFilterOrderExpression <TModel> exprASC = new DataFilterOrderExpression <TModel>
            {
                OrderByField     = orderByField,
                OrderByDirection = "ASC",
                Expression       = expressionASC
            };
            DataFilterOrderExpression <TModel> exprDESC = new DataFilterOrderExpression <TModel>
            {
                OrderByField     = orderByField,
                OrderByDirection = "DESC",
                Expression       = expressionDESC
            };

            CustomOrderExpressionList.Add(exprASC);
            CustomOrderExpressionList.Add(exprDESC);
            return(this);
        }