ObjectContext.Translate<T>
doesn't handle TPH types for T
. Is there way to read TPH types from a sproc easily in EF6? Assume the entire table record (along with the discriminator column) is read, with something like "select *" for maintainability in columns are added or changed.
I'm really trying to avoid creating a custom monolithic type that has all properties in the table to read the record, then switch on the discriminator to manually create and map the subtypes by hand. This seems like a huge oversight in the Translate method.
For example, even in EF Core, it seems there are attempt to replicate the Translate method, but I'm not sure the replicated logic handles TPH types: https://github.com/aspnet/EntityFrameworkCore/issues/8127#issuecomment-330973013 There's also a "Materialize" implementation: https://github.com/aspnet/EntityFrameworkCore/issues/8127#issuecomment-440011796 Assuming either of those support TPH, I'm looking for a similar implementation for EF6 to replace the Translate method.