C# 数据库第一个EF dnx EF dbcontext scaffold命令失败
使用dnx ef dbcontext scaffold命令后,我收到以下错误:C# 数据库第一个EF dnx EF dbcontext scaffold命令失败,c#,entity-framework,C#,Entity Framework,使用dnx ef dbcontext scaffold命令后,我收到以下错误: Unable to identify the primary key for table 'dbo.Report'. Unable to generate entity type for table 'dbo.Report'. 当前SQL架构 CREATE TABLE [dbo].[Report]( [ReportID] [int] IDENTITY(1000,1) NOT NULL,
Unable to identify the primary key for table 'dbo.Report'.
Unable to generate entity type for table 'dbo.Report'.
当前SQL架构
CREATE TABLE [dbo].[Report](
[ReportID] [int] IDENTITY(1000,1) NOT NULL,
[ReportName] [varchar](50) NOT NULL,
[StoredProcedureID] [int] NOT NULL,
[FileRepositoryID] [int] NULL
) ON [PRIMARY]
有人能告诉我哪里做错了吗?您的ReportID列未设置为主键。只要简单地添加主键约束就可以了
CREATE TABLE [dbo].[Report](
[ReportID] [int] PRIMARY KEY IDENTITY(1000,1) NOT NULL,
[ReportName] [varchar](50) NOT NULL,
[StoredProcedureID] [int] NOT NULL,
[FileRepositoryID] [int] NULL
) ON [PRIMARY]
成功了!非常感谢你!我应该更仔细地阅读-_-@FBaez51发生在我们最好的人身上!总是一些简单的事情哈哈。很高兴我能帮忙