Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

LINQ - Help with contains

Posted on 2013-06-13
2
Medium Priority
?
384 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

916 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