Open NikolaVranes opened 3 weeks ago
Additional information, insert commands are working as expected, only fetching data from DB isn't working.
This issue is lacking enough information for us to be able to fully understand what is happening. Please attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate.
I am encountering an issue with Entity Framework Core (EF Core) when using the Table-Per-Class (TPC) inheritance strategy. Specifically, the complex Timestamp property, defined in the base abstract class (AbstractType), is returning default values for it's properties for derived entities (ConcreteTypeA and ConcreteTypeB) during queries, while for ConcreteTypeC it's working as expected. ConcreteTypeC has no additional properties, and the timestamps are being mapped good, but on the other side ConcreteTypeA and ConcreteTypeB have additional properties and the timestamps are being defaulted since DateTime is a struct. I looked into the problem and debugged the queries that are generated. EF is generating a UNION in the SQL and the TimeStamp columns where being mapped in the following way. c."Timestamp_Local", c."Timestamp_Utc" on table C, and NULL AS "Timestamp_Local", NULL AS "Timestamp_Utc" on tables A and B.