cannot update identity column in Entity Framework Core

前端 未结 7 765
感情败类
感情败类 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:13

    This line solved my problem. Available from 1.1.1

    modelBuilder.Entity().Property(u => u.NumberId).Metadata.IsReadOnlyAfterSave = true;
    

提交回复
热议问题