AllMovieInfo = from movieInfo in AllMovieInfo
from countryMovie in movieInfo.SeenItWantToSeenIt
where countryMovie.Status==1
select movieInfo;
var seenitorderby = db.SeenItWantToSeeIt.Where(m => m.Status == 1).GroupBy(m => m.MovieID).Select(g => new {MovieID =g.Key,count=g.Count()}).OrderBy(o=>o.count);
List<int> seenItList=seenitorderby.Select(s=>s.MovieID).ToList();
AllMovieInfo = (from a in AllMovieInfo
from s in seenItList
where seenItList.Contains(a.MovieID)
select a).Distinct();
此查询根据“AllMovieInfo.MovieID”对结果进行排序,这很明显,但我必须根据“seenitorderby”的 id 对“结果”进行排序,例如:看到它 orderby 可能需要 movieID 2、25、7、14 ,25 那么我需要 AllMovieInfo 按照与 seeitorderby 相同的顺序。如何根据“seenitorderby”订购“结果”?