c# - How to return all the Objects that have their IDs inside a List of Long -


i have list of long values follow :-

list<long> relateduserid = new list<long>() ; 

but how can retrieve entity framework objects have id inside list. trying write such :-

return entities.user.where(a=>a.userid.contain(relateduserid)).include(a2=>a2.userdetails); 

can advice ?

you need check wheter relateduserid contains userid, got in wrong way. replace

where(a=>a.userid.contain(relateduserid)) 

with

where(a => relateduserid.contains(a.userid)) 

Comments