Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Created Issue: TPT - impossible to specify a different name for the primary key column [676]

$
0
0
When using TPT hierarchy inherited types can not override the name column of the primary key of the table.

Sample:

class Address { public Guid Id { get;set; } }
EntityTypeConfiguration<Address> { HasKey(e => e.Id); Property(e => e.Id).HasColumnName("Id"); }

class AddressOrganization { public Guid Id { get;set; } }
EntityTypeConfiguration<AddressOrganization> { HasKey(e => e.Id); Property(e => e.Id).HasColumnName("AddressId"); }

If you add the first inherited types, and then the base, then the name of the column will be [AddressId] for all types in hierarchy.
If you add the first base type and then inherited types, the column name is [Id].

This issue in versions 4.3.1 and 4.4.0 (5.0).

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>