zoukankan      html  css  js  c++  java
  • 升级到EF6 两个注意事项

    1、依据MSDN的官方描述:

    In previous versions of EF the code was split between core libraries (primarily System.Data.Entity.dll) shipped as part of the .NET Framework and out-of-band (OOB) libraries (primarily EntityFramework.dll) shipped in a NuGet package. EF6 takes the code from the core libraries and incorporates it into the OOB libraries. This was necessary in order to allow EF to be made open source. The consequence of this is that applications will need to be rebuilt against the moved types.
    
    This should be straightforward for applications that make use of DbContext as shipped in EF 4.1 and later. A little more work is required for applications that make use of ObjectContext but it still isn’t hard to do.
    在之前的EF版本中,代码被分割为主要的库(System.Data.Entity.dll)--作为.NET Framework的一部分载入,以及外围的库(主要就是 EntityFramework.dll)--作为NuGet载入。
    EF6将代码从核心库去除,然后将其合并到外围库中。这是必须的,因为这样可以使EF成为open source。这么做的后果就是应用必须根据移除的类型做重新的生成。
    这一点对于在EF4.1或其后的版本中使用DbContext的应用来说是没问题的。而使用ObjectContext的应用还需要做一点并不难的工作。

    2、EF 4.1.10031.0(自己机器上的版本)添加实体数据模型时,默认生成的是ObjectContext。

    而升级到EF5和EF6时,则默认生成的是DbContext。虽然两种数据库映射模型可以互转。但在更新的版本中官方推荐DbContext。

  • 相关阅读:
    Shodan在渗透测试及漏洞挖掘中的一些用法
    QUdpSocket 简单用法
    用QT操作数据库(本周学的)
    Qt使用UDp通信、套接字socket的成员函数bind()的作用
    ppm的含义
    数字的补数
    两数之和
    C++中的最大整数最小整数
    如何使用dockerfile将jar包生成镜像
    python3解决 json.dumps中文乱码
  • 原文地址:https://www.cnblogs.com/Benjamin/p/3520621.html
Copyright © 2011-2022 走看看