QStreamable.Take<TSource, TResult> Method (IQOrderedWindow<TSource>, UInt32, Expression<Func<CepRankedEvent<TSource>, TResult>>)
Takes the top count elements from an ordered window. If there are ties, all elements with the lowest rank are returned.
Namespace: Microsoft.ComplexEventProcessing.Linq
Assembly: Microsoft.ComplexEventProcessing (in Microsoft.ComplexEventProcessing.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function Take(Of TSource, TResult) ( _
source As IQOrderedWindow(Of TSource), _
count As UInteger, _
selector As Expression(Of Func(Of CepRankedEvent(Of TSource), TResult)) _
) As IQWindowResult(Of TResult)
'Usage
Dim source As IQOrderedWindow(Of TSource)
Dim count As UInteger
Dim selector As Expression(Of Func(Of CepRankedEvent(Of TSource), TResult))
Dim returnValue As IQWindowResult(Of TResult)
returnValue = source.Take(count, selector)
public static IQWindowResult<TResult> Take<TSource, TResult>(
this IQOrderedWindow<TSource> source,
uint count,
Expression<Func<CepRankedEvent<TSource>, TResult>> selector
)
[ExtensionAttribute]
public:
generic<typename TSource, typename TResult>
static IQWindowResult<TResult>^ Take(
IQOrderedWindow<TSource>^ source,
unsigned int count,
Expression<Func<CepRankedEvent<TSource>^, TResult>^>^ selector
)
static member Take :
source:IQOrderedWindow<'TSource> *
count:uint32 *
selector:Expression<Func<CepRankedEvent<'TSource>, 'TResult>> -> IQWindowResult<'TResult>
JScript does not support generic types and methods.
Type Parameters
- TSource
The source payload type.
- TResult
The output payload type.
Parameters
- source
Type: Microsoft.ComplexEventProcessing.Linq.IQOrderedWindow<TSource>
The input ordered window.
- count
Type: System.UInt32
The number of elements to take.
- selector
Type: System.Linq.Expressions.Expression<Func<CepRankedEvent<TSource>, TResult>>
The projection expression supporting production of result elements including ranks.
Return Value
Type: Microsoft.ComplexEventProcessing.Linq.IQWindowResult<TResult>
The window containing count elements.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IQOrderedWindow<TSource>. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=sql.111) or https://msdn.microsoft.com/en-us/library/bb383977(v=sql.111).