Click or drag to resize

XEnumerablePrependTSource Method

Note: This API is now obsolete.

Prepends the specified element to the specified sequence.

Namespace:  Linq.Extras
Assembly:  Linq.Extras (in Linq.Extras.dll) Version: 5.0.0+96a4f4bfed64095342c5df107c1fe1fb95603ee5
Syntax
[ObsoleteAttribute("This feature is now implemented directly in System.Linq. Please use Enumerable.Prepend instead")]
public static IEnumerable<TSource> Prepend<TSource>(
	IEnumerable<TSource> source,
	TSource item
)

Parameters

source
Type: System.Collections.GenericIEnumerableTSource
The sequence to prepend an element to.
item
Type: TSource
The element to prepend.

Type Parameters

TSource
The type of the elements of source.

Return Value

Type: IEnumerableTSource
The source sequence preceded by the prepended element.
Remarks
Linq already has this method in .NET Core, .NET Framework 4.7.1 and higher, and .NET Standard 1.6 and higher, so it's not included in Linq.Extras for these frameworks.
See Also