Open sandboxFocus

Class EnumerableExtensions

Extension methods for working with collections of compilation elements.

Inheritance
EnumerableExtensions
Namespace: Metalama.Framework.Code.Collections
Assembly: Metalama.Framework.dll
Syntax
[RunTimeOrCompileTime]
public static class EnumerableExtensions

Methods

Name Description
Any(IAttributeCollection)

Determines whether the attribute collection contains any elements.

Any(IAttributeCollection, Func<IAttribute, bool>)

Determines whether any element of the attribute collection satisfies a condition.

Cache<T>(IEnumerable<T>)

Caches an enumerable sequence as a read-only list. If the sequence is already a list, it is returned as-is; otherwise, the sequence is enumerated and cached.

SelectManyRecursiveDistinct<T>(IEnumerable<T>, Func<T, IEnumerable<T>?>, bool)

Selects the closure of a graph by recursively gathering children for each root item, and returns distinct items using reference equality.

SelectManyRecursiveDistinct<T>(IEnumerable<T>, Func<T, IEnumerable<T>?>, IEqualityComparer<T>, bool)

Selects the closure of a graph by recursively gathering children for each root item, and returns distinct items using a specified equality comparer.

SelectManyRecursiveDistinct<T>(T, Func<T, IEnumerable<T>?>, bool)

Selects the closure of a graph by recursively gathering children, starting from a single root item, and returns distinct items using reference equality.

SelectManyRecursive<T>(IEnumerable<T>, Func<T, IEnumerable<T>?>, bool)

Selects the closure of a graph by recursively gathering children for each root item. This is typically used to select all descendants of tree nodes.

SelectRecursive<T>(IEnumerable<T>, Func<T, T?>)

Selects a sequence by recursively applying a function to get the next item, for each item in a collection.

SelectRecursive<T>(T, Func<T, T?>)

Selects a sequence by recursively applying a function to get the next item, starting from a single initial item.

WhereNotNull<T>(IEnumerable<T?>)

Filters a sequence of nullable items to include only non-null items.