首页 新闻 会员 周边

linq to Entity Select()

0
[已解决问题] 解决于 2012-11-27 15:42

var d = from b in xedm.ServerInfo
           where b.ServerClass == intID
            select new
                     {
                       ServerTitle = b.ServerTitle,
                       ServerPrice = b.ServerPrice,
                       ServerContent = b.ServerContent,
                       ServerPic = "~/" + b.ServerPic
                     };

请教一下 上面的如何改成 下面的写法 select()里面要怎么写啊

 var d = xedm.ServerInfo.Where(c => c.ServerClass == intID).Select(xxx);

 

yellowshorts的主页 yellowshorts | 初学一级 | 园豆:162
提问于:2012-11-27 15:24
< >
分享
最佳答案
0

Select(b=> new
                     {
                       ServerTitle = b.ServerTitle,
                       ServerPrice = b.ServerPrice,
                       ServerContent = b.ServerContent,
                       ServerPic = "~/" + b.ServerPic
                     });

奖励园豆:5
Qlin | 老鸟四级 |园豆:2403 | 2012-11-27 15:35

可以 谢谢哈

yellowshorts | 园豆:162 (初学一级) | 2012-11-27 15:41
其他回答(1)
0

var d = xedm.ServerInfo.Where(c => c.ServerClass == intID).Select(new {ServerTitle = b.ServerTitle,
                       ServerPrice = b.ServerPrice,
                       ServerContent = b.ServerContent,
                       ServerPic = "~/" + b.ServerPic});

Launcher | 园豆:45045 (高人七级) | 2012-11-27 15:37

谢谢哈 

支持(0) 反对(0) yellowshorts | 园豆:162 (初学一级) | 2012-11-27 15:41
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册