1
简单问题:确认延迟加载LINQ到实体为我的程序存储库[简单]
我的仓库的部分看起来像这样
public class CustomerRepository : IRepository<Customer>
{
public IQueryable<Customer> GetAll()
{
MyDataEntities ent = new MyDataEntities();
return from c in ent.Customers select c;
}
}
现在可以说我有10,000名客户,如果我这样做:
var cus = from c in GetAll() where c.FirstName == "jon" select c;
请告诉我,GetAll()不会加载所有这些10,000但懒加载整个事情?是我需要在某处设置还是自动发生?
我不也知道如何检查它是否是延迟加载,是有什么事的时候看到实际的SQL查询被吐到SQL Server?
抱歉无知。
您能详细说明我可以在哪里看到配置文件吗?即时通讯使用SQL管理工作室Express 2008 R2 + VS 2010 – gideon 2010-12-22 18:37:39