Posted By

housecor on 09/08/10


parameter query Linq param

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


LINQ query in function that takes param to change resultset

 / Published in: C#

  1. IQueryable<Person> GetManagersWithName (IQueryable<Person> people, string name)
  2. {
  3. return from p in people
  4. where p.Name == name && // implicit closure over 'name'
  5. p.PersonType == PersonType.Manager
  6. select p;
  7. }

Report this snippet  

You need to login to post a comment.