Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
VB.NET
VB.NET General Discussion
Get a distinct list of values from a one property in a List (Of T)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="jmcilhinney, post: 184097, member: 641"] If what you want is a list of the distinct [I]Prop2[/I] values then just do this: [CODE=vbnet]Dim distinctList = MainList.Select(Function(mo) mo.Prop2).Distinct().ToList()[/CODE] There's no need for that extra type if all it will do is wrap the property values. Just use the property values themselves. In this case, [I]distinctList[/I] will be a [I]List(Of String)[/I]. [/QUOTE]
Insert quotes…
Verification
Post reply
VB.NET
VB.NET General Discussion
Get a distinct list of values from a one property in a List (Of T)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom