Skip to content

Instantly share code, notes, and snippets.

@EifelMono
Created August 5, 2014 05:39
Show Gist options
  • Save EifelMono/0e97603491cd003398cd to your computer and use it in GitHub Desktop.
Save EifelMono/0e97603491cd003398cd to your computer and use it in GitHub Desktop.
c# Extentions In
public static class Extentions
{
public static bool In<T>(this T value, params T[] args) where T : IComparable
{
foreach (T arg in args)
if (arg.Equals(value))
return true;
return false;
}
public static bool In<T>(this T value, IEnumerable<T> args) where T : IComparable
{
foreach (T arg in args)
if (arg.Equals(value))
return true;
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment