Table of Contents

Yield Method

Definition

Yield<T>(T)

Returns an IEnumerable<T> with the specified arg as the only element.

public static IEnumerable<T> Yield<T>(T arg)

Parameters

arg T

The T to type as IEnumerable<T>.

Returns

IEnumerable<T>

An IEnumerable<T> with the specified arg as the only element.

Type Parameters

T

The type of the element of arg.

Remarks

The Yield<T>(T) method has no effect other than to change the compile-time type of arg from T to IEnumerable<T>.