【问题标题】:EF Core migration error: PositionalParameterNotFound,Add-MigrationEF Core 迁移错误:PositionalParameterNotFound,Add-Migration
【发布时间】:2021-12-29 06:46:25
【问题描述】:

我正在使用 EntityFrameWork 当我尝试运行命令添加迁移时,我收到以下错误

Add-Migration migration space
+ CategoryInfo          : InvalidArgument: (:) [Add-Migration], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Add-Migration

我发现发生此错误是因为迁移名称中有一个“空格”。我也无法使用特殊字符创建迁移。有人可以向我解释一下添加新迁移应遵循哪些规则

【问题讨论】:

    标签: c# entity-framework asp.net-core entity-framework-core


    【解决方案1】:

    迁移生成类,因此迁移名称需要是有效的 C# 类名称。

    This thread 涵盖了类的命名规则。

    【讨论】:

      猜你喜欢
      • 2023-03-09
      • 2021-12-28
      • 2017-11-23
      • 1970-01-01
      • 2019-05-18
      • 2015-07-20
      • 2021-09-29
      • 2016-11-04
      • 1970-01-01
      相关资源
      最近更新 更多