In SQL, you could write a query such as:
SELECT NAME, QUOTA, SALES FROM SALESREPS
WHERE REP_OFFICE IN (11, 13, 52);
How would can I construct a IN set operation within LINQ?
In SQL, you could write a query such as:
SELECT NAME, QUOTA, SALES FROM SALESREPS
WHERE REP_OFFICE IN (11, 13, 52);
How would can I construct a IN set operation within LINQ?
 
    
    I assume we're talking LINQ to Objects here:
var x = from s in SalesReps 
        where new[] { 11, 13, 52 }.Contains(s.RepOffice) 
        select s;
 
    
    int[] nums = new { 11, 13, 52 };
IEnumerable<SalesRep> salesReps = 
    MyEntities.SalesReps.Where(s => nums.Contains(s.Rep_Office));
