DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="4.3.0" />

 SingletonList<T>

Represents a list with one element.

Represents an enumerator over the collection containing a single element.

public T this[int index] { get; set; }

Gets or sets the item in this list.

public T Item { get; set; }

Gets or sets the item in this list.

public SingletonList(T item)

Initializes a new list with one element.

public static SingletonList<T> op_Implicit(T item)

Converts a value to the read-only list.

Gets enumerator for the single element in the list.