If I have entities that inherit from a base entity (say "Widgets", "Gadgets", and "Gizmos" inherit from "Device") and I want to query Devices and return the specific type of each item in the resulting projection, like so:
from d in Devices
select new
{
Name = d.Name,
Type = d.GetType()
};
Which would return a list like:
Spring, Widget
Gear, Gizmo
Tape, Gadget
Scissors, Gizmo
Screw, Widget
Of course, EF complains because GetType() is not a SQL Server cannonical function. Is there a way to do this?