ImmutableArrayExtensions.Single Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Single<T>(ImmutableArray<T>) |
Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence. |
Single<T>(ImmutableArray<T>, Func<T,Boolean>) |
Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists. |
Single<T>(ImmutableArray<T>)
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static T Single(System::Collections::Immutable::ImmutableArray<T> immutableArray);
public static T Single<T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray);
static member Single : System.Collections.Immutable.ImmutableArray<'T> -> 'T
<Extension()>
Public Function Single(Of T) (immutableArray As ImmutableArray(Of T)) As T
Type Parameters
- T
The type of element contained by the collection.
Parameters
- immutableArray
- ImmutableArray<T>
The array to retrieve the element from.
Returns
The element in the sequence.
Applies to
Single<T>(ImmutableArray<T>, Func<T,Boolean>)
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
- Source:
- ImmutableArrayExtensions.cs
Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static T Single(System::Collections::Immutable::ImmutableArray<T> immutableArray, Func<T, bool> ^ predicate);
public static T Single<T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, Func<T,bool> predicate);
static member Single : System.Collections.Immutable.ImmutableArray<'T> * Func<'T, bool> -> 'T
<Extension()>
Public Function Single(Of T) (immutableArray As ImmutableArray(Of T), predicate As Func(Of T, Boolean)) As T
Type Parameters
- T
The type of element contained by the collection.
Parameters
- immutableArray
- ImmutableArray<T>
The immutable array to return a single element from.
Returns
Returns Boolean.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기