ImmutableArrayExtensions
LINQ extension method overrides that offer greater efficiency for ImmutableArray<T> than the standard LINQ methods
Applies a function to a sequence of elements in a cumulative way.
public static TAccumulate Aggregate<TAccumulate, T>(this ImmutableArray<T> immutableArray, TAccumulate seed, Func<TAccumulate, T, TAccumulate> func)
Applies a function to a sequence of elements in a cumulative way.
public static TResult Aggregate<TAccumulate, TResult, T>(this ImmutableArray<T> immutableArray, TAccumulate seed, Func<TAccumulate, T, TAccumulate> func, Func<TAccumulate, TResult> resultSelector)
Applies a function to a sequence of elements in a cumulative way.
Gets a value indicating whether all elements in this collection match a given condition.
Gets a value indicating whether any elements are in this collection.
Gets a value indicating whether any elements are in this collection that match a given condition.
Returns the element at a specified index in a sequence.
Returns the element at a specified index in a sequence or a default value if the index is out of range.
Returns the first element in a sequence that satisfies a specified condition.
Returns the first element in a sequence that satisfies a specified condition.
Returns the first element of a sequence, or a default value if the sequence contains no elements.
Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.
Returns the last element of a sequence.
Returns the last element of a sequence that satisfies a specified condition.
Returns the last element of a sequence, or a default value if the sequence contains no elements.
Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.
public static IEnumerable<TResult> Select<T, TResult>(this ImmutableArray<T> immutableArray, Func<T, TResult> selector)
Projects each element of a sequence into a new form.
public static bool SequenceEqual<TDerived, TBase>(this ImmutableArray<TBase> immutableArray, ImmutableArray<TDerived> items, IEqualityComparer<TBase> comparer = null) where TDerived : TBase
Determines whether two sequences are equal according to an equality comparer.
public static bool SequenceEqual<TDerived, TBase>(this ImmutableArray<TBase> immutableArray, IEnumerable<TDerived> items, IEqualityComparer<TBase> comparer = null) where TDerived : TBase
Determines whether two sequences are equal according to an equality comparer.
public static bool SequenceEqual<TDerived, TBase>(this ImmutableArray<TBase> immutableArray, ImmutableArray<TDerived> items, Func<TBase, TBase, bool> predicate) where TDerived : TBase
Determines whether two sequences are equal according to an equality comparer.
Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.
Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.
Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.
Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
Copies the contents of this array to a mutable array.
public static Dictionary<TKey, T> ToDictionary<TKey, T>(this ImmutableArray<T> immutableArray, Func<T, TKey> keySelector)
Creates a dictionary based on the contents of this array.
public static Dictionary<TKey, TElement> ToDictionary<TKey, TElement, T>(this ImmutableArray<T> immutableArray, Func<T, TKey> keySelector, Func<T, TElement> elementSelector)
Creates a dictionary based on the contents of this array.
public static Dictionary<TKey, T> ToDictionary<TKey, T>(this ImmutableArray<T> immutableArray, Func<T, TKey> keySelector, IEqualityComparer<TKey> comparer)
Creates a dictionary based on the contents of this array.
public static Dictionary<TKey, TElement> ToDictionary<TKey, TElement, T>(this ImmutableArray<T> immutableArray, Func<T, TKey> keySelector, Func<T, TElement> elementSelector, IEqualityComparer<TKey> comparer)
Creates a dictionary based on the contents of this array.
public static IEnumerable<T> Where<T>(this ImmutableArray<T> immutableArray, Func<T, bool> predicate)
Filters a sequence of values based on a predicate.