Created
August 5, 2014 05:39
-
-
Save EifelMono/0e97603491cd003398cd to your computer and use it in GitHub Desktop.
c# Extentions In
This file contains hidden or 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
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