Exemplo n.º 1
0
        public void TestQueryParamJoiner()
        {
            Repository <DictInfo>       repository = new Repository <DictInfo>(Con, null);
            Repository <Articles>       repos      = new Repository <Articles>(Con, null);
            QueryParamJoiner <Articles> qq         = new QueryParamJoiner <Articles>();

            qq.AddItem <DictInfo, int>(repository, x => x.DictName, QueryParamJoinerOprater.Contains, x => x.DictID, x => x.DictID);
            var nv2 = new System.Collections.Specialized.NameValueCollection();

            nv2.Add("DictName", "技术副");
            var aa = qq.GetExpression(nv2);
            var l2 = repos.Where(aa);
        }
Exemplo n.º 2
0
        public void TestLeftExpression()
        {
            Repository <DictInfo>       repository  = new Repository <DictInfo>(Con, null);
            Repository <Articles>       repos       = new Repository <Articles>(Con, null);
            Repository <Author>         reposAuthor = new Repository <Author>(Con, null);
            QueryParamJoiner <Articles> qq          = new QueryParamJoiner <Articles>();

            qq.AddItem <DictInfo, int>(repository, x => x.DictName, QueryParamJoinerOprater.Contains, x => x.DictID, x => x.DictID);
            var nv2 = new System.Collections.Specialized.NameValueCollection();

            nv2.Add("DictName", "技术副");
            var aa = qq.GetExpression(nv2);

            var bb = aa.LeftExpression <Author, Articles, int>(repos, x => x.AId, x => x.Id);
            var l3 = reposAuthor.Where(bb);
        }