【问题标题】:.Net Core 2.0 to 2.1: 'IMutableEntityType' does not contain a definition for 'Scaffolding'.Net Core 2.0 到 2.1:“IMutableEntityType”不包含“脚手架”的定义
【发布时间】:2018-07-21 07:21:59
【问题描述】:

我们有一个使用 psql 数据库的 .Net Core 2.0 API。 更新到 .Net Core 2.1 时,它停止构建并返回以下错误:

'IMutableEntityType' does not contain a definition for 'Scaffolding' and no extension method 'Scaffolding' accepting a first argument of type 'IMutableEntityType' could be found (are you missing a using directive or an assembly reference?)

此扩展方法不适合外部使用,但我们需要它在运行时更改实体架构。

【问题讨论】:

    标签: entity-framework .net-core .net-core-2.1


    【解决方案1】:

    这是一个单一的班轮,但我花了一些时间才发现我必须改变

    builder.Entity(type).Metadata.Scaffolding();
    

    builder.Entity(type).Metadata.Relational();
    

    我希望它可以帮助某人。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多