linq联合查询例子

where_model wm=new  where_model ();
    wm.kid = 58;
    IList mlist = BasicDataProxy.teacher_GetList(wm);

创新互联建站专注于企业营销型网站建设、网站重做改版、临海网站定制设计、自适应品牌网站建设、HTML5建站成都做商城网站、集团公司官网建设、外贸网站建设、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为临海等各大城市提供网站开发制作服务。

    IList klist = BasicDataProxy.kin_roleinfo_GetList(wm);

    mlist = (from x in mlist
              where (x.title == "" && x.did != 1324 && x.userid>0)
              orderby x.did
              select x
              ).ToList();

    var list = (from x in mlist
                join p in klist on x.kid equals p.kid
                where (p.rid > 1000)
                select new kininfo()
                {

                    kid=x.kid,
                    rid=p.rid,
                    title=x.title,
                    uname=x.uname
                });

 

 

var list = (from x in mlist
                join p in klist on x.kid equals p.kid
                where (p.rid > 1000)
                group p by new {
                    x.kid,
                    x.uname
                }into g 
                select new kininfo()
                {

                    kid = g.Count(),
                    rid = g.Sum(x=>x.rid+g.Key.kid),
                    uname=g.Key.uname
                });


本文名称:linq联合查询例子
文章出自:http://ybzwz.com/article/pepjse.html