Can I make this two LINQ queries into one query only?
- by Holli
From a List of builtAgents I need all items with OptimPriority == 1 and only 5 items with OptimPriority == 0. I do this with two seperate queries but I wonder if I could make this with only one query.
IEnumerable<Agent> priorityAgents =
from pri in builtAgents where pri.OptimPriority == 1 select pri;
IEnumerable<Agent> otherAgents =
(from oth in builtAgents where oth.OptimPriority == 0 select oth).Take(5);