数据库优先EF7-7.0.0-rc1-final dnx ef dbcontext scaffold命令失败

时间:2016-01-05 16:46:44

标签: asp.net-core dnx entity-framework-core

我正在使用此命令:

dnx ef dbcontext scaffold "Server=webuat08,1433,Database=Store;user    
id=user_here;password=password_here" EntityFramework.MicrosoftSqlServer

数据库“存储”存在。但我收到以下错误:

Unable to identify the primary key for table 'dbo.spt_fallback_db'.
Unable to generate entity type for table 'dbo.spt_fallback_db'.
Unable to identify the primary key for table 'dbo.spt_fallback_dev'.
Unable to generate entity type for table 'dbo.spt_fallback_dev'.
Unable to identify the primary key for table 'dbo.spt_fallback_usg'.
Unable to generate entity type for table 'dbo.spt_fallback_usg'.
Could not find type mapping for column 
'dbo.MSreplication_options.optname'     with data type 'sysname'. Skipping column.
Unable to identify the primary key for table 'dbo.MSreplication_options'.
Unable to generate entity type for table 'dbo.MSreplication_options'.
Unable to identify the primary key for table 'dbo.spt_monitor'.
Unable to generate entity type for table 'dbo.spt_monitor'.
Done

如果我将命令中的数据库名称更改为不存在的数据库,我仍然会收到相同的错误。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

您需要将主键放在表格中