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
Post a Comment