?
Solved

LINQ - Help with contains

Posted on 2013-06-13
2
Medium Priority
?
387 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
  • 2
2 Comments
 
LVL 42

Expert Comment

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

Accepted Solution

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

Featured Post

Technology Partners: 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 …
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.
Suggested Courses
Course of the Month9 days, 12 hours left to enroll

609 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