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).
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).