Created
March 25, 2014 14:03
-
-
Save davidbreyer/9762497 to your computer and use it in GitHub Desktop.
Select distinct items from a List using LINQ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var distinctMessages = messages.GroupBy(x => x.Text).Select(group => group.First()).ToList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment