public static IEnumerable<char> WhereAny(this IEnumerable<char> chars, CharTypes types) { var predicate = Enum.GetValues(typeof(CharTypes)) .Cast<CharTypes>() .ToDictionary(x => x, MapPredicate) .Where(x => types.HasFlag(x.Key)) .Select(x => x.Value) .AnyTrue(); return chars.Where(predicate); }
public static IEnumerable <char> WhereAny(this IEnumerable <char> chars, CharTypes types) { var predicate = Enum.GetValues(typeof(CharTypes)) .Cast <CharTypes>() .ToDictionary(x => x, MapPredicate) .Where(x => types.HasFlag(x.Key)) .Select(x => x.Value) .AnyTrue(); return(chars.Where(predicate)); }