entity framework核心不包含“包含”的定义
我正在尝试使用Entity Framework Core 1.0并尝试在通过dbcontext填充对象时使用.Include。
EFTestContext context = new EFTestContext(); var testEntity = context.TestEntity .Include(t => t.TestEntity2) .ToList();
它给了我错误
不包含’Include’的定义,也没有扩展方法’Include’接受’DbSet’类型的第一个参数可以找到
到目前为止我在Stackoverflow中找到的唯一类似的东西是
IQueryable 不包含’Include’的定义,也没有包含’Include’的扩展方法
但是添加using语句
using System.Data.Entity;
只是给我错误
命名空间’System.Data’中不存在类型或命名空间名称’Entity’(您是否缺少程序集引用?)
任何人都知道我需要什么才能让Wlude Core 1.0出现?
根据github上的这个例子,这里是使用的:
using Microsoft.EntityFrameworkCore; using System.Linq;