c# - create query that uses IN returning wrong values -
the query
select * positiontable position in (51000785,52012986)
returns 2 records position column '51000785' in first record , '52012986' in second.
using c# want return same results..i have tried
string allpositions = "51000785,52012986"; list<positiontable> position = new list<positiontable>(); position = dbcontext.positiontablelist .where<positiontable>(p => p.position == allpositions) .tolist();
this result returns nothing, how can change ==allpositions 'in (allpositions)' possible?
thanks
try this:-
var allpositions = new string[] { "51000785", "52012986" }; var x = p in dbcontext.positiontablelist allpositions.contains(p.position) select p;
wiki
Comments
Post a Comment