Click or drag to resize
IEnumerableExtensionMethodsToReadOnlyCollectionTDestination Method
Converts the enumerable to a ReadOnlyCollection.

Namespace:  SD.Tools.BCLExtensions.CollectionsRelated
Assembly:  SD.Tools.BCLExtensions (in SD.Tools.BCLExtensions.dll) Version: 1.1.1
Syntax
public static ReadOnlyCollection<TDestination> ToReadOnlyCollection<TDestination>(
	this IEnumerable source
)

Parameters

source
Type: System.CollectionsIEnumerable
the enumerable to convert

Type Parameters

TDestination

Return Value

Type: ReadOnlyCollectionTDestination
A ReadOnlyCollection with the elements of the passed in enumerable, or an empty ReadOnlyCollection if source is null or empty

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable. 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