62,046
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ConsoleApplication4.Model;
using System.Diagnostics;
using System.Data.Objects.DataClasses;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
NorthwindEntities db = new NorthwindEntities();
db.Configuration.LazyLoadingEnabled = false;
IQueryable<Employee> employees = from e in db.Employees
select e;
foreach (Employee e in employees)
{
db.LoadProperty(e, e => e.Orders); //编译器提示找不到LoadProperty方法
if (e.IsLoaded) //编译器提示找不到IsLoaded属性
e.Load(); //编译器提示找不到Load方法
}
Console.ReadKey();
}
}
}
using System.Data.Entity;
http://msdn.microsoft.com/en-us/library/system.data.entity.dbextensions.load(v=vs.103).aspx