Click or drag to resize
ExtensionMethodsCastCovariantTFrom, TTo Method
Casts enumerable of TFrom to enumerable of TTo on platforms where covariance is not supported.

Namespace: System.Collections.Generic
Assembly: Telerik.Windows.Documents (in Telerik.Windows.Documents.dll) Version: 2017.3.1018.40 (2017.3.1018.40)
Syntax
public static IEnumerable<TTo> CastCovariant<TFrom, TTo>(
	this IEnumerable<TFrom> elements
)
where TFrom : class, TTo

Parameters

elements
Type: System.Collections.GenericIEnumerableTFrom

Type Parameters

TFrom
TTo

Return Value

Type: IEnumerableTTo

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableTFrom. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also