【问题标题】:What is the equivalent of System.Data.Entity in Entity Framework Core 2.2.4?Entity Framework Core 2.2.4 中 System.Data.Entity 的等价物是什么?
【发布时间】:2019-10-10 14:54:45
【问题描述】:

我尝试在.NET Core 2.2的项目中使用IObjectSet接口,但是使用Entity Framework Core 2.2.4的版本,它不起作用。

这是在 .NET Core 2.2.0 中

IObjectSet<TEntity> GetGroup<TEntity>() where TEntity : class, IObjectWithChangeTracker;

找不到类型或命名空间“IObjectSet”的名称。

【问题讨论】:

    标签: c# .net-core-2.2


    【解决方案1】:

    您需要更新 EF7 。在 EntityFramework System.Data 中是版本 6,在这种情况下,您可以使用 System.Data 并且在 EF7 中您应该使用 EntityFramework.* nuget 包 如下所示

     using Microsoft.EntityFrameworkCore.*;
    

    使用前请阅读文档 https://github.com/aspnet/EntityFrameworkCore/tree/d1b10fc6ccca83e29109a0a8d9c047f2e68aede5

    【讨论】:

    • 谢谢,检查一下,在 Entity Framework Core 2 中仍然没有等价物,如果它对我有用,实际上在 EF7 中,但我正在进行迁移,我遇到了这个问题。
    猜你喜欢
    • 2021-11-14
    • 2020-05-04
    • 2019-07-28
    • 2017-07-24
    • 2018-08-30
    • 2011-01-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多