Class EnumerableExtensions
Extensions for System.Linq
.
Namespace: IPA.Utilities
Assembly: IPA.Loader.dll
Syntax
public static class EnumerableExtensions : object
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 |
---|---|---|
IEnumerable<T> | self | the enumeration to filter |
Returns
Type | Description |
---|---|
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 |
---|---|---|
IEnumerable<Nullable<T>> | self | the enumeration to filter |
Returns
Type | Description |
---|---|
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 |
---|---|---|
IEnumerable<T> | self | the enumeration to filter |
Func<T, U> | pred | the predicate to select for filtering |
Returns
Type | Description |
---|---|
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 |
---|---|---|
IEnumerable<T> | self | the enumeration to filter |
Func<T, Nullable<U>> | pred | the predicate to select for filtering |
Returns
Type | Description |
---|---|
IEnumerable<T> | a filtered enumerable |
Type Parameters
Name | Description |
---|---|
T | the type of the enumeration |
U | the type of the predicate's resulting nullable |