Solved

Linq help

Posted on 2016-10-25
1
16 Views
Last Modified: 2016-10-25
I have a collection of Product IEnumerable<Product> products.
            How can i filter this collection with an IList<string> items using linq.
0
Comment
Question by:JRockFL
1 Comment
 
LVL 42

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 41858665
Probably going to need more info here - your question isn't particularly clear.

Normally you'd filter your list with the Where() extension method, for example:

products.Where(p => p.Category == 'Food').ToList();
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

14 Experts available now in Live!

Get 1:1 Help Now