1
Reply

Linq Queries with array

yusuf

yusuf

Sep 11 2009 6:28 AM
2.2k
Hi,

i got some int values like 1,4,9 lets say (an array) etc. and have a table Product. With Linq query i gotta check if ProducutID contains any value in that array.

i just did something by trial and error like below, and sure it doesn't work.

 int[] nValue = new int[emlakListesi.Count];
            nValue[0] = 48;
            nValue[1] = 1;
           
            var query = from s in db.Emlaks   
                        from n in nValue
                        where s.EmlakID.ToString().Contains(n)
                        select s;

thanks.

Answers (1)