Solved

LINQ - Help with contains

Posted on 2013-06-13
2
375 Views
Last Modified: 2013-06-13
Hi..
I need to write a linq statement that queries a CUSTOMER object for all the CUSTOMER_ID in a List<string>

myList - contains 100+ CUSTOMER_IDS which are strings


var query = from c in Customers where id in  myList  ???????

thx in advance
0
Comment
Question by:JElster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 39245993
var query = from c in Customers where myList.Contains(id.ToString())
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 39245996
Correction:
var query = from c in Customers where myList.Contains(c.id.ToString())
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question