c# - Getting the selected datalist by an array -


i going ask basic question , repeated 1 have bit different situation. want use "in" operator in linq. have rows table has id provided array , returns row if has. how can it.

my array has

var aa="1091","1092","1093" , on.

and table uses these ids primary keys .i have rows id contained in array , not want use s.p.

you can use enumerable.contains,

var aa = new string[3] { "1091", "1092", "1093" }; var res = yourdatasource.where(c => aa.contains(c.id)); 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -