【发布时间】:2018-12-12 03:27:07
【问题描述】:
使用FluentAPI 我是autoincreamenting 我的表的主键。
FluentAPI 配置如下:
mb.ToTable("StationeryItems");
builder.HasKey(c => c.StationeryItemId);
我得到的异常:
无法为表中的标识列插入显式值 IDENTITY_INSERT 设置为 OFF 时的“StationeryItems”。
【问题讨论】:
标签: c# .net entity-framework ef-fluent-api