ImmutableArrayExtensions.LastOrDefault 方法    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| LastOrDefault<T>(ImmutableArray<T>) | 返回序列中的最后一个元素;如果序列中不包含任何元素,则返回默认值。 | 
| LastOrDefault<T>(ImmutableArray<T>.Builder) | 返回集合中的最后一个元素;如果集合为空,则返回默认值。 | 
| LastOrDefault<T>(ImmutableArray<T>, Func<T,Boolean>) | 返回序列中满足条件的最后一个元素;如果未找到这样的元素,则返回默认值。 | 
LastOrDefault<T>(ImmutableArray<T>)
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
返回序列中的最后一个元素;如果序列中不包含任何元素,则返回默认值。
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T LastOrDefault(System::Collections::Immutable::ImmutableArray<T> immutableArray);public static T LastOrDefault<T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray);public static T? LastOrDefault<T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray);static member LastOrDefault : System.Collections.Immutable.ImmutableArray<'T> -> 'T<Extension()>
Public Function LastOrDefault(Of T) (immutableArray As ImmutableArray(Of T)) As T类型参数
- T
集合包含的元素的类型。
参数
- immutableArray
- ImmutableArray<T>
要从中检索项的数组。
返回
序列中的最后一个元素;如果序列中不包含任何元素,则为默认值。
适用于
LastOrDefault<T>(ImmutableArray<T>.Builder)
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
返回集合中的最后一个元素;如果集合为空,则返回默认值。
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T LastOrDefault(System::Collections::Immutable::ImmutableArray<T>::Builder ^ builder);public static T LastOrDefault<T> (this System.Collections.Immutable.ImmutableArray<T>.Builder builder);public static T? LastOrDefault<T> (this System.Collections.Immutable.ImmutableArray<T>.Builder builder);static member LastOrDefault : System.Collections.Immutable.ImmutableArray<'T>.Builder -> 'T<Extension()>
Public Function LastOrDefault(Of T) (builder As ImmutableArray(Of T).Builder) As T类型参数
- T
生成器中的项类型。
参数
- builder
- ImmutableArray<T>.Builder
要从中检索元素的生成器。
返回
序列中的最后一个元素;如果序列中不包含任何元素,则为默认值。
适用于
LastOrDefault<T>(ImmutableArray<T>, Func<T,Boolean>)
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
返回序列中满足条件的最后一个元素;如果未找到这样的元素,则返回默认值。
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T LastOrDefault(System::Collections::Immutable::ImmutableArray<T> immutableArray, Func<T, bool> ^ predicate);public static T LastOrDefault<T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, Func<T,bool> predicate);public static T? LastOrDefault<T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, Func<T,bool> predicate);static member LastOrDefault : System.Collections.Immutable.ImmutableArray<'T> * Func<'T, bool> -> 'T<Extension()>
Public Function LastOrDefault(Of T) (immutableArray As ImmutableArray(Of T), predicate As Func(Of T, Boolean)) As T类型参数
- T
集合包含的元素的类型。
参数
- immutableArray
- ImmutableArray<T>
要从中检索元素的数组。
返回
序列中的最后一个元素;如果序列中不包含任何元素,则为默认值。