Solved

LINQ - Help with contains

Posted on 2013-06-13
2
369 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: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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now