IEnumerableExtensionMethodsToReadOnlyCollectionTDestination Method |
Converts the enumerable to a ReadOnlyCollection.
Namespace:
SD.Tools.BCLExtensions.CollectionsRelated
Assembly:
SD.Tools.BCLExtensions (in SD.Tools.BCLExtensions.dll) Version: 1.0.0.0 (1.0.10.1127)
Syntax public static ReadOnlyCollection<TDestination> ToReadOnlyCollection<TDestination>(
this IEnumerable source
)
<ExtensionAttribute>
Public Shared Function ToReadOnlyCollection(Of TDestination) (
source As IEnumerable
) As ReadOnlyCollection(Of TDestination)
Parameters
- source
- Type: System.CollectionsIEnumerable
the enumerable to convert
Type Parameters
- TDestination
Return Value
Type:
ReadOnlyCollectionTDestinationA 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