How do I remove underscore of foreign key fields in code first by convention

前端 未结 7 910
傲寒
傲寒 2020-11-30 01:20

I\'ve got multiple classes (including TPT) in my project. Each POCO has a BaseClass, which has a GUID (called GlobalKey) as primary ke

相关标签:
7条回答
  • 2020-11-30 01:52

    I know this is a bit old, but here is a sample how I specify mapping columns through my fluent config (OnModelCreating):

    modelBuilder.Entity<Application>()
                .HasOptional(c => c.Account)
                    .WithMany()
                    .Map(c => c.MapKey("AccountId"));
    

    Hope this helps,

    0 讨论(0)
提交回复
热议问题