var list = new List<int> {1, 2, 3};
if (1 | list)
{
// it in there
}
public static class CollectionExtensions
{
extension<T>(ICollection<T>)
{
public static bool operator |(T elem, ICollection<T> collection) => collection.Contains(elem);
}
}
extension<T>(ICollection<T>)
{
public static bool operator >(T elem, ICollection<T> collection) => collection.Contains(elem);
public static bool operator <(T elem, ICollection<T> collection) => !collection.Contains(elem);
}
In<T>(this T item, IEnumerable<T> col)