数据访问用了 entity,数据库中有个player表 ,每个player 有个score,我想获得某个player的score的排名,该怎么写啊
using (var data = new Entities1()) {
Player player = data.Player.FirstOrDefault(d => d.Email_address == email);
}
------解决方案--------------------------------------------------------
oderby,排序。
------解决方案--------------------------------------------------------
using (var data = new Entities1()) {
var players = data.Player.orderby(p=>p.id);
int i=0;
foreach(var item idn players)
{
i++;
if(item.Email_address == email)
{
break;
}
}
}
------解决方案--------------------------------------------------------
var tr = from p in player
orderby score
select p;