How to Specify Primary Key Name in EF-Code-First

后端 未结 5 639
眼角桃花
眼角桃花 2020-12-01 10:37

I\'m using Entity Framework Codefirst to create my Database. The default Primary key with the schema name dbo.pk_Jobs seems to upset access 2007 when I connect to it over OD

5条回答
  •  离开以前
    2020-12-01 11:09

    If I understand, you are asking how to change the name of the primary key column used by Entity Framework. The following addition to your HasKey statement should take care of this:

    modelBuilder.Entity().Property(j => j.uuid).HasColumnName("pk_Jobs")
    

提交回复
热议问题