将表添加到数据实体模型时遇到麻烦。
已安装EntityFramework 6.1.3
VS Enterprise 2017 15.9.3
复制步骤:
当我进入Model.Context.cs时,我在新添加的表中看到以下行:
modelBuilder.Configurations.Add(new MyTable_Mapping());
但MyTable_Mapping带下划线并抱怨文件丢失。
在Model.Mapping.cs内部读取
ErrorGeneratingOutput
我的表模式:
CREATE TABLE [dbo].[MyTable](
[Id] [bigint] IDENTITY(1,1) NOT NULL,
[AccountUserId] [int] NOT NULL,
[MFAUserId] [bigint] NOT NULL,
[LastAuthDate] [datetime] NOT NULL,
[CreateDate] [datetime] NOT NULL,
[StatusId] [int] NOT NULL,
CONSTRAINT [PK_MyTable] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]