Geta.EPi.Extensions : API Documentation

Type EnumerableExtensions

Namespace Geta.EPi.Extensions

Enumerable extensions.

Methods

Public static methods

IEnumerable<T> OrEmptyIfNull<T>(this IEnumerable<T> source)

Returns empty sequence if source sequence is null otherwise returns source sequence. NOTE: Helper extension to work with legacy APIs which might return null references of IEnumerable.
Parameters
IEnumerable<T> source
The IEnumerable`1 to check.
Returns
IEnumerable<T>
An IEnumerable`1 that contains elements from the input sequence of type or empty sequence.

IEnumerable<T> SafeOfType<T>(this IEnumerable source)

Filters the elements of an IEnumerable based on a specified type. Returns empty sequence if source sequence is null. NOTE: Helper extension to work with legacy APIs which might return null references of IEnumerable.
Parameters
IEnumerable source
The IEnumerable whose elements to filter.
Returns
IEnumerable<T>
An IEnumerable`1 that contains elements from the input sequence of type .