日期:2014-05-20  浏览次数:20679 次

Iqueryable<>合并问题

 var temp = from c in menbers
                      select new
                      {
                          id = c.id,
                          companyname = c.companyname
                      };
            int j = temp.Count();
            var adding = from c in menbers
                       select new
                       {
                           id = 10000,
                           companyname = "火热招租中..."
                       };

请问:temp和adding能够合并在一起用来绑定?具体方法是?
------解决方案--------------------
temp.Concat(adding)
------解决方案--------------------
引用:
temp.Concat(adding)

结果集是在temp里面吗。我怎么datalist绑定temp。还是只有一个数据啊
------解决方案--------------------
temp = temp.Concat(adding); //这样才在temp里面。
------解决方案--------------------

                var temp = (from u in menbers
                            select new
                            {
                                id = u.id,
                                companyname = u.companyname
                            }).Union(
                             from n in menbers