Yes, I can provide scenarios where you need a list of basic types. Unfortunately, there is no way to get discriminator (designation) in the conceptual model. The only way I can think of is something like
db.BaseObjects.Where(b => ...) .AsEnumerable().Select (b => new {b.GetType().Name, b } )
After that you can sort / group by type name. But you cannot project ( Select ) to AsEnumerable , so the only way to limit the size of the data is by filtering ( Where ).
There is a trick to getting the discriminator column as a visible property in the class model. You can create a computed column in the table that simply displays the column value of the real discriminator and matches it with the property that is marked as DatabaseGeneratedOption.Computed .
Please note that this requires special attention with the code first (migration). And this requires some performance with inserts and updates, because EF subsequently needs to read the value from the database.
source share