c# - migrating to dbcontext LINQ where clause string parameter -


i'm migrating project objectcontext dbcontext , have problem sentence:

var query = db.inventory.where("it.idstate in {" + states + "}"); 

this works objectcontext error @ compilation time:

error   cs1503  argument 2: cannot convert 'string' 'system.linq.expressions.expression<system.func<test.dal.inventory, bool>>'  

seems not posible now, tryied expose objectcontext it, couldn't find way

any idea? thank!

you can (and should) type these arguments expression.

var query = db.inventory.where(x => states.contains(x.idstate)); 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

excel - I can't get the attachement of the email PHP -

node.js - Express and Redis - If session exists for this user, don't allow access -