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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -

python - Read npy file directly from S3 StreamingBody -