ImmutableList.ToImmutableList 方法
定义
重载
ToImmutableList<TSource>(IEnumerable<TSource>) |
枚举序列,并生成其内容的不可变列表。Enumerates a sequence and produces an immutable list of its contents. |
ToImmutableList<TSource>(ImmutableList<TSource>.Builder) |
从生成器集合的当前内容创建不可变列表。Creates an immutable list from the current contents of the builder's collection. |
ToImmutableList<TSource>(IEnumerable<TSource>)
枚举序列,并生成其内容的不可变列表。Enumerates a sequence and produces an immutable list of its contents.
public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableList<TSource> ^ ToImmutableList(System::Collections::Generic::IEnumerable<TSource> ^ source);
public static System.Collections.Immutable.ImmutableList<TSource> ToImmutableList<TSource> (this System.Collections.Generic.IEnumerable<TSource> source);
static member ToImmutableList : seq<'Source> -> System.Collections.Immutable.ImmutableList<'Source>
<Extension()>
Public Function ToImmutableList(Of TSource) (source As IEnumerable(Of TSource)) As ImmutableList(Of TSource)
类型参数
- TSource
序列中元素的类型。The type of the elements in the sequence.
参数
- source
- IEnumerable<TSource>
要枚举的序列。The sequence to enumerate.
返回
- ImmutableList<TSource>
一个不可变列表,其中包含指定序列中的项。An immutable list that contains the items in the specified sequence.
适用于
ToImmutableList<TSource>(ImmutableList<TSource>.Builder)
从生成器集合的当前内容创建不可变列表。Creates an immutable list from the current contents of the builder's collection.
public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
static System::Collections::Immutable::ImmutableList<TSource> ^ ToImmutableList(System::Collections::Immutable::ImmutableList<TSource>::Builder ^ builder);
public static System.Collections.Immutable.ImmutableList<TSource> ToImmutableList<TSource> (this System.Collections.Immutable.ImmutableList<TSource>.Builder builder);
static member ToImmutableList : System.Collections.Immutable.ImmutableList<'Source>.Builder -> System.Collections.Immutable.ImmutableList<'Source>
<Extension()>
Public Function ToImmutableList(Of TSource) (builder As ImmutableList(Of TSource).Builder) As ImmutableList(Of TSource)
类型参数
- TSource
列表中元素的类型。The type of the elements in the list.
参数
- builder
- ImmutableList<TSource>.Builder
要从中创建不可变列表的生成器。The builder to create the immutable list from.
返回
- ImmutableList<TSource>
包含生成器集合中的当前内容的不可变列表。An immutable list that contains the current contents in the builder's collection.