c# - Searching on an array of integers -


i've got string coming in so:

 '202,203,204,205,226,230,274' 

i want break string down array of numbers , records ids.

so far, have:

string[] myarray = mystring.split(','); int[] myintarray = new int[myarray.length];   for(int x = 0; x < myarray.length; x++) {      myintarray[x] = convert.toint32(myarray[x].tostring());  }   model.records = db.records      .where(q => q.recordid.contains(myintarray)      .tolist(); 

it's complaining contains not working ints. confused contains does?

thanks in advance!

i think want do:

.where(q => myintarray.contains(q.recorid)) 

the way have it, you're expecting recordid array (i'm assuming it's int?), whereas think want take single recordid , see if it in array of ints.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -