专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > LINQ

EF无法访问LoadProperty访问的有关问题

发布时间:2011-06-24 21:21:20 文章来源:www.iduyao.cn 采编人员:星星草
EF无法访问LoadProperty访问的问题
程序代码如下,开发环境为VS2012 .NET + Framework 4.5 + EntityFramework 5.0


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方法
      }
            Console.ReadKey();
        }
    }
}



求解,谢谢!

------解决方案--------------------
using System.Data.Entity;
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: