How do I write this as an expression?
- by itchi
I'm trying to rewrite a linq to entities query to an expression. My model is a School can have many Persons where 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>;
...but it does not. Am I misunderstanding the .Select()?