As you can see in the following image, I have a model with a base class "Person" and both entities "Kunde" and "Techniker" inherit the base class.
abload.de/img/snapshot_entitydbmodefvkge.png (cannot post pictures due to not being verified)
Now I've got following problem. When I try to use the method Find to get an object of the derived class Kunde with given ID, it tells me that OfType<TResult> is a method and isn't valid in this context. I've added a screenshot just in case my description
of the problem isn't perfectly understandable.
abload.de/img/snapshot_kundegetbyid29rtp.png
public Kunde GetById(int id)
{
return dbModel.PersonMenge.OfType<Kunde>.Find(id);
}
I've also tried to drop the OfType<Kunde> but it obviously tells me that the object Person cannot be implicitly converted to Kunde.
Is there anything I'm missidng here?