© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•15mo ago•
12 replies
MC

Search object Inner list for value

My googlefu is failing for this one.

I have a list of an outer class (Board) that contains a (inner) list of another class (Properties).
Properties is essentially a dictionary (the object gets saved to XML, and you can't serialise a dictionary) with two properties, Property and Value, which are used to store various properties of the parent/outer class.

What I'm need to do, is search the inner list for a defined property (Connector), with a specific value (JP1).
I have suitable Linq that returns all the Board's, which have a Property set with the Property of Connector, but I'm struggling with how to check if that Property is set to JP1-
boards = Boards.Where(x => x.Properties.All(p => p.Property == "Connector")).ToList();

Can anybody point me in the correct direction?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

how to search for a value in a list
C#CC# / help
4y ago
Search generic list for a searchword
C#CC# / help
4y ago
Fast search an object in a list using his attribute
C#CC# / help
3y ago
Is List.Contains(Object) checks by address or by value?
C#CC# / help
16mo ago