Skip to content

Instantly share code, notes, and snippets.

@yetanotherchris
Last active December 12, 2015 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yetanotherchris/4757292 to your computer and use it in GitHub Desktop.
Save yetanotherchris/4757292 to your computer and use it in GitHub Desktop.
IComparer example #2
public class UserAgeComparer : IComparer
{
public int CompareTo(Object x, Object y)
{
User userX = x as User;
User userY = y as User;
if (userX != null & userY != null)
{
// compare the age.
}
else
{
return 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment