我试图与实体框架核心1.0一起工作,并试图通过dbcontext填充对象时使用.include。实体框架核心不包含“包含”的定义
EFTestContext context = new EFTestContext();
var testEntity = context.TestEntity
.Include(t => t.TestEntity2)
.ToList();
它给我的错误
不包含定义为“包括”没有扩展方法“包含”接受型“DbSet”的第一个参数可以发现
唯一我在#1迄今为止发现类似的事情是
IQueryable<T> does not contain a definition for 'Include' and no extension method 'Include'
但添加using语句
using System.Data.Entity;
只要给我的错误
类型或命名空间名称“实体”不存在命名空间“System.Data”存在(是否缺少程序集引用?)
任何人都知道我需要什么让包含WF Core 1.0出现?
愚蠢的问题,但你'使用Microsoft.EntityFrameworkCore做;'在你的代码。你提到'使用System.Data.Entity;' –