Table per Hierarchy without discriminator in EF core

388 Views Asked by At

There is a existing database and we have multiple columns to decide Table Per Hierarchy.It is not convenient to add any new column as discriminator. We have Table Per Hierarchy database structure as below.

  • Product - Base Entity (Database Table)
  • Glass - Child Entity (Model class)
  • Parts - Child Entity (Model class)
  • Others - Child Entity.(Model class)

(Update) Discrimination as below,

  • Glass - ProductID > 1Lac < 2Lac & ProductType = 1,2,3,4,5,100
  • Parts - ProductID > 2Lac <= 3Lac & ProductType = 100,101,201,203,204
  • Others -ProductID > 3Lac <= 4Lac & ProductType = All other product type.

Table also contains columns (VarBinary, XML type) which shares between Base and Child entities as per type. I want to get Records for Glass structure from Product table. How can I get this without any discriminator column provided?

0

There are 0 best solutions below