c# - Entity Framework Core 2.2.4 中 System.Data.Entity 的等价物是什么?
问题描述
我尝试IObjectSet
在 .NET Core 2.2 的项目中使用该接口,但是使用 Entity Framework Core 2.2.4 的版本,它不起作用。
这是在 .NET Core 2.2.0 中
IObjectSet<TEntity> GetGroup<TEntity>() where TEntity : class, IObjectWithChangeTracker;
找不到类型或命名空间“IObjectSet<>”的名称。
解决方案
您需要更新 EF7。在 EntityFramework System.Data
中是版本 6,在这种情况下,您可以使用 System.Data
并且在 EF7 中您应该使用 EntityFramework.* nuget 包,如下所示
using Microsoft.EntityFrameworkCore.*;
使用前阅读文档 https://github.com/aspnet/EntityFrameworkCore/tree/d1b10fc6ccca83e29109a0a8d9c047f2e68aede5
推荐阅读
- python - 以 ip:port 格式解析工作“masscan”的结果
- linux - Live Linux grep 脚本 - 仅打印正面结果
- javascript - 将 CDNJS 与 LibMan 一起用于 Moment.JS
- neo4j - Neo4j - 如何在保存或更新相关节点时删除与另一个节点的关系
- node.js - 在 Firebase 存储中更新图像预览
- google-apps-script - 设置表单响应表名称
- css - Webpack 4:mini-css-extract-plugin + 文件加载器不加载资产
- python - Keras自定义损失函数访问python全局变量的内部机制是什么?
- javascript - 需要帮助简化 Immutable.js 对象数组更新
- python - 在pytest中导入文件不匹配