【问题标题】:Difference between the code generated from DbContext Generator for EF 5.x and EF 6.x DbContextGenerator从 DbContext Generator for EF 5.x 和 EF 6.x DbContextGenerator 生成的代码之间的区别
【发布时间】:2014-07-12 15:09:08
【问题描述】:

由于我在我的项目中使用 EF6,并且我使用 VS2012 生成了我的 edmx,它默认使用“EF 5.x DbContext Generator”来生成 edmx 和所有相关代码。由于我的 edmx 和所有相关代码用于英孚 5.0。所以谁能告诉我当我从 EF 6.x DbContextGenerator 而不是 EF 5.x DbContext Generator 生成我的 edmx 时,我将在 edmx 的 .tt 和 context.tt 代码文件中得到什么区别。 我也使用过 EF 6.x DbContextGenerator 并没有注意到 edmx 及其相关代码的任何变化。

【问题讨论】:

    标签: asp.net-mvc entity-framework t4 edmx edmx-designer


    【解决方案1】:

    生成的代码中最明显的区别之一是名称空间的变化,例如:

    System.Data.Entity -> System.Data.Entity.Core
    System.Data.Objects -> System.Data.Entity.Core.Objects
    

    【讨论】:

    • 感谢您的通知,但此更改将反映在哪里,仅在 context.tt 文件中对吗?你能告诉我context.tt文件有什么用吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-06-14
    • 2018-03-06
    • 1970-01-01
    • 2021-04-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多