ImmutableArrayExtensions.Single 메서드

정의

오버로드

Single<T>(ImmutableArray<T>)

시퀀스의 유일한 요소를 반환하고, 시퀀스에 요소가 정확히 하나 들어 있지 않으면 예외를 throw합니다.

Single<T>(ImmutableArray<T>, Func<T,Boolean>)

시퀀스에서 지정된 조건에 맞는 유일한 요소를 반환하고, 이러한 요소가 둘 이상 있으면 예외를 throw합니다.

Single<T>(ImmutableArray<T>)

시퀀스의 유일한 요소를 반환하고, 시퀀스에 요소가 정확히 하나 들어 있지 않으면 예외를 throw합니다.

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

형식 매개 변수

T

컬렉션에 의해 포함되는 요소의 형식입니다.

매개 변수

immutableArray
ImmutableArray<T>

요소를 검색할 배열입니다.

반환

T

시퀀스의 요소입니다.

적용 대상

Single<T>(ImmutableArray<T>, Func<T,Boolean>)

시퀀스에서 지정된 조건에 맞는 유일한 요소를 반환하고, 이러한 요소가 둘 이상 있으면 예외를 throw합니다.

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

형식 매개 변수

T

컬렉션에 의해 포함되는 요소의 형식입니다.

매개 변수

immutableArray
ImmutableArray<T>

단일 요소를 반환할 변경할 수 없는 배열입니다.

predicate
Func<T,Boolean>

요소를 반환해야 하는지 여부를 테스트하는 함수입니다.

반환

T

Boolean를 반환합니다.

적용 대상