Class EnumerableExtensions
Extensions for System.Collections.Generic.IEnumerable<T> that don't currently exist in System.Linq
.
Inheritance
Inherited Members
Namespace: IPA.Utilities
Assembly: IPA.Loader.dll
Syntax
public static class EnumerableExtensions
Methods
| Improve this Doc View SourceNonNull<T>(IEnumerable<T>)
LINQ-style extension method that filters null elements out of an enumeration.
Declaration
public static IEnumerable<T> NonNull<T>(this IEnumerable<T> self)
where T : class
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | self | the enumeration to filter |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | a filtered enumerable |
Type Parameters
Name | Description |
---|---|
T | the type of the enumeration |
NonNull<T>(IEnumerable<Nullable<T>>)
LINQ-style extension method that filters null elements from an enumeration of nullable types.
Declaration
public static IEnumerable<T> NonNull<T>(this IEnumerable<T?> self)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Nullable<T>> | self | the enumeration to filter |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | a filtered enumerable |
Type Parameters
Name | Description |
---|---|
T | the underlying type of the nullable enumeration |
NonNull<T, U>(IEnumerable<T>, Func<T, U>)
LINQ-style extension method that filters null elements out of an enumeration based on a converter.
Declaration
public static IEnumerable<T> NonNull<T, U>(this IEnumerable<T> self, Func<T, U> pred)
where U : class
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | self | the enumeration to filter |
System.Func<T, U> | pred | the predicate to select for filtering |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | a filtered enumerable |
Type Parameters
Name | Description |
---|---|
T | the type of the enumeration |
U | the type to compare to null |
NonNull<T, U>(IEnumerable<T>, Func<T, Nullable<U>>)
LINQ-style extension method that filters null elements out of an enumeration based on a converter to a nullable type.
Declaration
public static IEnumerable<T> NonNull<T, U>(this IEnumerable<T> self, Func<T, U?> pred)
where U : struct
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | self | the enumeration to filter |
System.Func<T, System.Nullable<U>> | pred | the predicate to select for filtering |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | a filtered enumerable |
Type Parameters
Name | Description |
---|---|
T | the type of the enumeration |
U | the type of the predicate's resulting nullable |