我在 Migration
文件夹中有两种不同的配置类型
。当我启用迁移时,VS
生成了一个。我为新创建的 DbContext 添加了另一个。现在,当我在Package Manager Console
中运行Add-Migration
时,系统会要求我指定配置文件的名称。
PM> Add-Migration AddedMessageProperty
More than one migrations configuration type was found in the assembly 'WorkingMigrations'. Specify the name of the one to use.
问题是我如何在命令中指定属性名称?
最佳答案
您只需在添加新迁移时指定配置类型名称作为参数即可:
Add-Migration -ConfigurationTypeName ConfigNameGoesHere addedMessageProperty
关于c# - 如何指定配置类型的名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24776023/