using (db = new InsuranceEntities())
{
db.Configuration.ProxyCreationEnabled = false;
db.Configuration.LazyLoadingEnabled = false;
var result = db.CustomerQuotations.Where(m => m.IsActive == true)
.Include(m => m.CustomerDetails)
.Include(m => m.User.Role)
.Include(m => m.DocumentDetails);
return result;
}
如果我包含用户属性。那么User属性也包含CustomerQuotation列表,所以我可以在实体框架中避免这种情况。