Language

ImmutableArray.ToImmutableArray Method

Definition

Overloads

Name Description
ToImmutableArray(ReadOnlySpan)

Produce an immutable array of contents from specified elements.

ToImmutableArray(Span)

Converts the span to an immutable array.

ToImmutableArray(IEnumerable)

Creates an immutable array from the specified collection.

ToImmutableArray(ImmutableArray.Builder)

Creates an immutable array from the current contents of the builder's array.

ToImmutableArray(ReadOnlySpan)

Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs

Produce an immutable array of contents from specified elements.

public:
generic 
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Immutable::ImmutableArray ToImmutableArray(ReadOnlySpan items);
public static System.Collections.Immutable.ImmutableArray ToImmutableArray(this ReadOnlySpan items);
static member ToImmutableArray : ReadOnlySpan<'T> -> System.Collections.Immutable.ImmutableArray<'T>

Public Function ToImmutableArray(Of T) (items As ReadOnlySpan(Of T)) As ImmutableArray(Of T)

Type Parameters

T

The type of element in the list.

Parameters

items
ReadOnlySpan

The elements to store in the array.

Returns

An immutable array containing the items in the span.

Applies to

ToImmutableArray(Span)

Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs

Converts the span to an immutable array.

public:
generic 
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Immutable::ImmutableArray ToImmutableArray(Span items);
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static System.Collections.Immutable.ImmutableArray ToImmutableArray(this Span items);
public static System.Collections.Immutable.ImmutableArray ToImmutableArray(this Span items);
[]
static member ToImmutableArray : Span<'T> -> System.Collections.Immutable.ImmutableArray<'T>
static member ToImmutableArray : Span<'T> -> System.Collections.Immutable.ImmutableArray<'T>

Public Function ToImmutableArray(Of T) (items As Span(Of T)) As ImmutableArray(Of T)

Type Parameters

T

The type of element in the list.

Parameters

items
Span

The elements to store in the array.

Returns

An immutable array containing the items in the span.

Attributes

Applies to

ToImmutableArray(IEnumerable)

Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs

Creates an immutable array from the specified collection.

public:
generic 
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Immutable::ImmutableArray ToImmutableArray(System::Collections::Generic::IEnumerable ^ items);
public static System.Collections.Immutable.ImmutableArray ToImmutableArray(this System.Collections.Generic.IEnumerable items);
static member ToImmutableArray : seq<'Source> -> System.Collections.Immutable.ImmutableArray<'Source>

Public Function ToImmutableArray(Of TSource) (items As IEnumerable(Of TSource)) As ImmutableArray(Of TSource)

Type Parameters

TSource

The type of elements contained in items.

Parameters

items
IEnumerable

The collection of objects to copy to the immutable array.

Returns

An immutable array that contains the specified collection of objects.

Applies to

ToImmutableArray(ImmutableArray.Builder)

Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs
Source:
ImmutableArray.cs

Creates an immutable array from the current contents of the builder's array.

public:
generic 
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Immutable::ImmutableArray ToImmutableArray(System::Collections::Immutable::ImmutableArray::Builder ^ builder);
public static System.Collections.Immutable.ImmutableArray ToImmutableArray(this System.Collections.Immutable.ImmutableArray.Builder builder);
static member ToImmutableArray : System.Collections.Immutable.ImmutableArray<'Source>.Builder -> System.Collections.Immutable.ImmutableArray<'Source>

Public Function ToImmutableArray(Of TSource) (builder As ImmutableArray(Of TSource).Builder) As ImmutableArray(Of TSource)

Type Parameters

TSource

The type of elements contained in the immutable array.

Parameters

builder
ImmutableArray.Builder

The builder to create the immutable array from.

Returns

An immutable array that contains the current contents of the builder's array.

Applies to