I'm trying to rewrite a LINQ To Entities query to an expression. My model is a School which can have many Persons. Persons are inherited out to teachers, students, etc.
The following query works for me:
IQueryable<DAL.TEACHER> teacher =
from p in School
select p.PERSON as ESBDAL.TEACHER;
How would I write this as a query expression? I thought something like:
IQueryable<DAL.TEACHER> teacher =
School.Select(x=>x.PERSON) as IQueryable<DAL.TEACHER>;
Unfortunately this statement doesn't work. Am I misunderstanding the .Select()
?