我在 C# 项目中有这个 linq 查询
var query = from p in db.Posts
join a in db.Author on p.Author equals a
join u in db.Users on p.PostedBy equals u
where p.IsActive.Equals(true)
orderby p.PostedDate descending
select new ViewModel
{
...
};
如果我where p.IsActive.Equals(true)
靠近from p in db.Posts
,比如
var query = from p in db.Posts
where p.IsActive.Equals(true) //Moved
join a in db.Author on p.Author equals a
join u in db.Users on p.PostedBy equals u
orderby p.PostedDate descending
select new ViewModel
{
...
};
它会对查询的性能产生任何影响吗?