tags:

views:

88

answers:

2
IEnumerable<string> periods = new string[] {"ABC", "JKD", "223A"};

var someData = from p in returns  
               from d in p.ReturnDet  
               where p.Year > 2009 
               where d.Period <is in periods array> 

How do I select values where the d.periods are contained in the periods array?

+10  A: 

Use the Contains method.

var someData = from p in returns   
               from d in p.ReturnDet   
               where p.Year > 2009  
               where periods.Contains(d.Period);
Adam Sills
+2  A: 
var someData = from p in returns  
      from d in p.ReturnDet  
                where p.Year > 2009 
                where periods.Contains(d.Period)
Steve Danner