Method SafeYield
SafeYield<T>(T?)
Wraps this object instance into an IEnumerable<T> consisting of a single item.
If the item is null, returns an empty enumerable instead.
public static IEnumerable<T> SafeYield<T>(this T? item)
Parameters
itemTThe instance that will be wrapped.
Returns
- IEnumerable<T>
An IEnumerable<T> consisting of a single item.
Type Parameters
TType of the object.