/// <summary> /// Searches for the specified element. /// </summary> /// <typeparam name="T">Type of elements stored in the relation</typeparam> /// <param name="rel">Unary relation</param> /// <param name="x">Element to look for</param> /// <returns>Sequence of occurences (either empty or containing exactly one element)</returns> public static IEnumerable <T> Find <T>(this ImmutableRelation <T> rel, T?x) where T : struct { return(rel.Find(x == null ? ItemMatcher <T> .Any : new ItemMatcher <T>(x.Value))); }
/// <summary> /// Searches for the specified element. /// </summary> /// <typeparam name="T">Type of elements stored in the relation</typeparam> /// <param name="rel">Unary relation</param> /// <param name="x">Element to look for</param> /// <returns>Sequence of occurences (either empty or containing exactly one element)</returns> public static IEnumerable <T> Find <T>(this ImmutableRelation <T> rel, T x) where T : class { return(rel.Find(x == null ? ItemMatcher <T> .Any : new ItemMatcher <T>(x))); }