Table of Contents

Method SafeYield

Namespace
Anvil.API
Assembly
NWN.Anvil.dll

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

item T

The instance that will be wrapped.

Returns

IEnumerable<T>

An IEnumerable<T> consisting of a single item.

Type Parameters

T

Type of the object.