Enumerable.TryGetNonEnumeratedCount<TSource> 메서드

정의

열거형을 강제하지 않고 시퀀스의 요소 수를 확인하려고 시도합니다.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static bool TryGetNonEnumeratedCount(System::Collections::Generic::IEnumerable<TSource> ^ source, [Runtime::InteropServices::Out] int % count);
public static bool TryGetNonEnumeratedCount<TSource> (this System.Collections.Generic.IEnumerable<TSource> source, out int count);
static member TryGetNonEnumeratedCount : seq<'Source> * int -> bool
<Extension()>
Public Function TryGetNonEnumeratedCount(Of TSource) (source As IEnumerable(Of TSource), ByRef count As Integer) As Boolean

형식 매개 변수

TSource

source 요소의 형식입니다.

매개 변수

source
IEnumerable<TSource>

개수를 셀 요소가 들어 있는 시퀀스입니다.

count
Int32

이 메서드가 반환될 때 요소 수를 source포함하거나, 열거형 없이 개수를 확인할 수 없는 경우 0을 포함합니다.

반환

Boolean

true 개수를 source 열거 없이 확인할 수 있으면 이고, false그렇지 않으면 .

설명

이 메서드는 일련의 형식 테스트를 수행하여 열거하지 않고 개수를 확인할 수 있는 일반적인 하위 형식을 식별합니다. 여기에는 LINQ 구현에 사용되는 내부 형식 및 해당 형식이 포함됩니다ICollection<T>ICollection.

이 메서드는 일반적으로 일정한 시간 작업이지만 궁극적으로는 기본 컬렉션 구현의 복잡성 특성에 따라 달라집니다.

적용 대상