Skip to content

Instantly share code, notes, and snippets.

@pparadis

pparadis/distinct.cs

Last active Aug 29, 2015
Embed
What would you like to do?
Distinct
class Program
{
static void Main(string[] args)
{
var users = new List<User>
{
new User
{
FirstName = "Pascal",
LastName = "Paradis",
LoginInformation = new LoginInformation
{
LoginLocation = "Montréal"
}
},
new User
{
FirstName = "L'homme",
LastName = "Poux",
LoginInformation = new LoginInformation
{
LoginLocation = "Montréal"
}
}
};
Console.WriteLine(users.Distinct(new User.Comparer()).Single().LoginInformation.LoginLocation);
Console.ReadLine();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment