cannot update identity column in Entity Framework Core

前端 未结 7 752
感情败类
感情败类 2021-01-04 00:52

I\'ve added a separate Identification to the AspNetUsers table called NumericId that will serve along with the GUID like ID that ASP has for default.

I\'ve added the

7条回答
  •  时光取名叫无心
    2021-01-04 01:10

    If you are using EF Core 2.1, you can try that.

    builder.Property(e => e.ColumnName).Metadata.AfterSaveBehavior = PropertySaveBehavior.Ignore;
    

    It worked for me.

    IsReadOnlyAfterSave is deprecated.

提交回复
热议问题