Table of Contents

Method AsList

Namespace
Gamelogic.Extensions.Algorithms
Assembly
Gamelogic.Extensions.dll

AsList<T>(IEnumerable<T>)

Converts the source to an IReadOnlyList<T>.

[Version(3, 0, 0)]
public static IReadOnlyList<T> AsList<T>(this IEnumerable<T> source)

Parameters

source IEnumerable<T>

The source to convert.

Returns

IReadOnlyList<T>

The source as an IReadOnlyList<T>.

Type Parameters

T

The type of elements in the source.

Remarks

If the source is already an IList<T>, it is casted, otherwise it is converted to an List<T> using ToList<TSource>(IEnumerable<TSource>).