EF 6.0的.include DbExtension在哪里? [英] Where is .Include DbExtension for EF 6.0?

查看:105
本文介绍了EF 6.0的.include DbExtension在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

EF 6.0是否不包含DbExtensions lib?我有一个返回的通用仓库和IQueryable,我希望能够在需要时按需调用.include(i => i.SomeEntity)。

Was DbExtensions lib not included for EF 6.0? I have a generic repo that returns and IQueryable and I'd like to be able to call .Include(i => i.SomeEntity) on demaind when needed.

推荐答案

我要回答自己的问题。您没有引用版本6的System.Data.Entity来获取DbExtensions。您需要引用EntityFramework本身,并在cs文件顶部使用System.Data.Entity进行添加,然后将包含.Include()。

I'm going to answer my own question. You don't make a reference to System.Data.Entity for version 6 to get the DbExtensions. You need to reference the EntityFramework itself and add using System.Data.Entity at the top of your cs file and the .Include() will be there.

这篇关于EF 6.0的.include DbExtension在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆