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。

  • 相关阅读:
    第一次c++团队合作项目第三篇随笔
    第一次c++团队合作项目第二篇随笔
    第一次c++团队合作作业期间第一篇随笔
    电梯调度程序
    给我留下深刻印象的三位老师
    一个带有富文本功能的记事本
    我也忘了第几次团队作业
    关于复数输入输出的一点见解
    c++团队作业工作笔记
    又要开始新的征程了hhh(这次内容比较感兴趣)
  • 原文地址:https://www.cnblogs.com/Benjamin/p/3520621.html
Copyright © 2011-2022 走看看