我有一种方法可以从数据库中的视图中获取全部数据:
public IQueryable<vw_FullWebIgnoringApprovalStatus> GetAllFullWebIgnoringApprovalStatus()
{
IQueryable<vw_FullWebIgnoringApprovalStatus> query =
Context.vw_FullWebIgnoringApprovalStatus;
return query;
}
当我执行以下方法时,它会立即执行它不应该执行的查询:
var model = _repo.GetAllFullWebIgnoringApprovalStatus()
.Where(x =>
(!reid.HasValue && !destid.HasValue && !coid.HasValue) ||
(reid.HasValue && x.Reid == reid.Value) ||
(destid.HasValue && x.Destid == destid.Value) ||
(coid.HasValue && x.Coid == coid.Value)
);
它应该延迟加载查询,但没有。跟视图有关系吗?我正在使用 EntityFramework.4.3.1。