使用Linq的Union方法,配合Entity Framework,在同一个上可以使用的次数有上限IQueryable
吗?
考虑这个片段,显然有点做作:
public IQueryable<Person> GetPeople(IEnumerable<PersonDto> candidates)
{
var successful = this.peopleRepository.All().Where(p => false);
foreach(var candidate in candidates)
{
if (candidate.IsSuccessful())
{
var successfulCandidate = this.peopleRepository.All()
.Where(p => p.id == candidate.id);
successful = successful.Union(successfulCandidate);
}
}
return successful;
}
IQueryables
我可以使用 Entity Framework 和 SQL Server联合并仍然获得结果的次数是否有限制?