Exemple #1
0
        protected void VisitWhere()
        {
            var modifier        = new WhereTreeModifier(Queryable);
            var filterWhereExpr = DataFilterMetaInfoParser.Parse <TEntity>(Filter, FilterMateInfo, string.Empty);

            modifier.Modify(m_InternalExpr, filterWhereExpr);
            m_InternalExpr = modifier.ModifiedResult;
        }
Exemple #2
0
        public void Verity_ParseContainsFieldShouldBeWork()
        {
            var filter = new MyOrderFilter()
            {
                UserId = new ContainsField <int>
                {
                    CompareMode = CompareMode.Contains,
                    SortMode    = SortMode.Asc,
                    Values      = new int[] { 10000 }
                }
            };

            var exprTree2 = DataFilterMetaInfoParser.Parse <MyOrder>(filter);

            Assert.Equal(exprTree2.NodeType, ExpressionType.Lambda);
            Assert.Equal(exprTree2.ToString(), "OhLq_P1 => value(System.Int32[]).Contains(OhLq_P1.UserId)");

            var exprTree3 = DataFilterMetaInfoParser.Parse <MyOrder>(filter, "_myParam");

            Assert.Equal(exprTree3.NodeType, ExpressionType.Lambda);
            Assert.Equal(exprTree3.ToString(), "_myParam => value(System.Int32[]).Contains(_myParam.UserId)");
        }