'Contains()' workaround using Linq to Entities?

前端 未结 10 2138
清酒与你
清酒与你 2020-11-22 14:01

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 any

10条回答
  •  情书的邮戳
    2020-11-22 14:50

    I think a Join in LINQ can be a walkaround.

    I haven't tested the code though. Hope it helps. Cheers. :-)

    List txnIds = new List();
    // Fill list 
    
    var q = from t in svc.OpenTransaction
            join tID in txtIds on t equals tID
            select t;
    

    Join in LINQ:

    http://weblogs.asp.net/salimfayad/archive/2008/07/09/linq-to-entities-join-queries.aspx

提交回复
热议问题