M42.Collections by Daniel Pelsmaeker

<PackageReference Include="M42.Collections" Version="0.6.5056.5071" />

 EnumerableExt

public static class EnumerableExt
Provides methods for working with IEnumerable<T> sequences.
public static IEnumerable<Association<TKey, TValue>> Associate<TKey, TValue>(this IEnumerable<TKey> keys, IEnumerable<TValue> values)

Associates an enumerable collection of keys with an enumerable collection of values.

public static bool IsEmpty<T>(this IEnumerable<T> enumerable)

Returns whether the specified enumerable is empty.

public static IEnumerable<T> Of<T>(T value)

Returns an enumerable with a single value when that value is not null, or an empty enumerable.

public static Array<TSource> ToM42Array<TSource>(this IEnumerable<TSource> source)

Creates an array with the elements from the enumerable collection.

public static HashMap<TKey, TValue> ToM42Dictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> valueSelector, IEqualityComparer<TKey> comparer)

Creates a dictionary with the elements from the enumerable collection.

public static HashMap<TKey, TValue> ToM42Dictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> valueSelector)

Creates a dictionary with the elements from the enumerable collection.

public static HashMap<TKey, TSource> ToM42Dictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)

Creates a dictionary with the elements from the enumerable collection.

public static HashMap<TKey, TSource> ToM42Dictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)

Creates a dictionary with the elements from the enumerable collection.

public static ArrayList<TSource> ToM42List<TSource>(this IEnumerable<TSource> source)

Creates a list with the elements from the enumerable collection.

public static IMutableSet<TSource> ToM42Set<TSource>(this IEnumerable<TSource> source)

Creates a set with the elements from the enumerable collection.

public static IMutableSet<TSource> ToM42Set<TSource>(this IEnumerable<TSource> source, IEqualityComparer<TSource> comparer)

Creates a set with the elements from the enumerable collection.