尝试找到解决方案,但我不能。实体随机从数据库中选择C#MVC
所以问题是下一个。我有数据库的EDM模型。我有一个功能类来从数据库中获取数据。 这样的:
public IQueryable<photos> FindUserPhotos(string userlogin)
{
return from m in db.photos
where m.userlogin == userlogin
select m;
}
如何从数据库中获得随机10行?
[从Sql的Linq随机行]的可能重复(http://stackoverflow.com/questions/648196/random-row-from-linq-to-sql) – 2011-04-27 16:32:48