Click or drag to resize
BaseExtensionsToListTFrom, TTo Method

Note: This API is now obsolete.

Converts the given collection to a list of values

Namespace: CMS.Base
Assembly: CMS.Base (in CMS.Base.dll) Version: 9.0.0
Syntax
C#
[ObsoleteAttribute("This method is obsolete. Use LINQ Select and ToList methods.")]
public static List<TTo> ToList<TFrom, TTo>(
	this IEnumerable<TFrom> values,
	Func<TFrom, TTo> transform,
	bool removeEmptyEntries = false
)
where TTo : class

Parameters

values
Type: System.Collections.GenericIEnumerableTFrom
Values
transform
Type: SystemFuncTFrom, TTo
Transformation of the original object to the result
removeEmptyEntries (Optional)
Type: SystemBoolean
If true, empty (null) entries are not included into the list

Type Parameters

TFrom
TTo

Return Value

Type: ListTTo

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