'Contains()' workaround using Linq to Entities?

Posted by jbloomer on Stack Overflow See other posts from Stack Overflow or by jbloomer
Published on 2008-12-17T11:24:20Z Indexed on 2010/04/30 4:57 UTC
Read the original article Hit count: 305

I'm trying to create a query which uses a list of ids in the where clause, using the Silverlight ADO.Net Data Services client api (and therefore Linq To Entities). Does anyone know of a workaround to Contains not being supported?

I want to do something like this:

List<long?> txnIds = new List<long?>();
// Fill list 

var q = from t in svc.OpenTransaction
        where txnIds.Contains(t.OpenTransactionId)
        select t;

© Stack Overflow or respective owner

Related posts about linq-to-entities

Related posts about entity-framework