ImmutableList.Create 方法

定义

重载

名称 说明
Create<T>()

创建空的不可变列表。

Create<T>(ReadOnlySpan<T>)

创建包含指定项范围中的项的新不可变列表。

Create<T>(T)

创建包含指定项的新不可变列表。

Create<T>(T[])

创建包含指定项数组的新不可变列表。

Create<T>()

Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs

创建空的不可变列表。

public:
generic <typename T>
 static System::Collections::Immutable::ImmutableList<T> ^ Create();
public static System.Collections.Immutable.ImmutableList<T> Create<T>();
static member Create : unit -> System.Collections.Immutable.ImmutableList<'T>
Public Function Create(Of T) () As ImmutableList(Of T)

类型参数

T

要存储在 . 中的项的类型。

返回

空的不可变列表。

适用于

Create<T>(ReadOnlySpan<T>)

Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs

创建包含指定项范围中的项的新不可变列表。

public:
generic <typename T>
 static System::Collections::Immutable::ImmutableList<T> ^ Create(ReadOnlySpan<T> items);
public static System.Collections.Immutable.ImmutableList<T> Create<T>(scoped ReadOnlySpan<T> items);
public static System.Collections.Immutable.ImmutableList<T> Create<T>(ReadOnlySpan<T> items);
static member Create : ReadOnlySpan<'T> -> System.Collections.Immutable.ImmutableList<'T>
Public Function Create(Of T) (items As ReadOnlySpan(Of T)) As ImmutableList(Of T)

类型参数

T

集合存储的项的类型。

参数

items
ReadOnlySpan<T>

包含要预先填充列表的项的跨度。

返回

包含指定项的新不可变列表。

适用于

Create<T>(T)

Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs

创建包含指定项的新不可变列表。

public:
generic <typename T>
 static System::Collections::Immutable::ImmutableList<T> ^ Create(T item);
public static System.Collections.Immutable.ImmutableList<T> Create<T>(T item);
static member Create : 'T -> System.Collections.Immutable.ImmutableList<'T>
Public Function Create(Of T) (item As T) As ImmutableList(Of T)

类型参数

T

中项的类型。

参数

item
T

要预填充列表的项。

返回

包含指定项的新项。

适用于

Create<T>(T[])

Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs
Source:
ImmutableList.cs

创建包含指定项数组的新不可变列表。

public:
generic <typename T>
 static System::Collections::Immutable::ImmutableList<T> ^ Create(... cli::array <T> ^ items);
public static System.Collections.Immutable.ImmutableList<T> Create<T>(params T[] items);
static member Create : 'T[] -> System.Collections.Immutable.ImmutableList<'T>
Public Function Create(Of T) (ParamArray items As T()) As ImmutableList(Of T)

类型参数

T

中项的类型。

参数

items
T[]

包含要预先填充列表的项的数组。

返回

包含指定项的新不可变列表。

适用于