views:

373

answers:

1

When I have entity B inherit from entity A using table-per-type for storage and try to write a Linq query that filters on a property on B, for example

Function(b) b.name="Joe"

I get the error

The specified type member 'name' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.

Filtering on any of the properties that exist in the base table works fine. Any idea what I'm doing wrong?

+1  A: 

Found the answer here. I needed to add .OfType(MySubClass)() to my entity in the from clause to see the subclass properties.

adam0101