Export (0) Print
Expand All

ImmutableArray.ToImmutableArray<TSource> Method

[This topic is preliminary and is subject to change.]

Creates an immutable array from the specified collection.

Namespace:  System.Collections.Immutable
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

public static ImmutableArray<TSource> ToImmutableArray<TSource>(
	this IEnumerable<TSource> items

Type Parameters


The type of elements contained in items.


Type: System.Collections.Generic.IEnumerable<TSource>

The collection of objects to copy to the immutable array.

Return Value

Type: System.Collections.Immutable.ImmutableArray<TSource>
An immutable array that contains the specified collection of objects.

Usage Note

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