Share via


CepStream.Take<TInput, TResult> Method (CepOrderedStream<TInput>, UInt32, Expression<Func<CepRankedEvent<TInput>, TResult>>)

Takes a given number of events from each window and also evaluates the given expression. This is used for cases in which you want to project the rank into the result of Take().

Namespace:  Microsoft.ComplexEventProcessing.Linq
Assembly:  Microsoft.ComplexEventProcessing (in Microsoft.ComplexEventProcessing.dll)

Syntax

public static CepStream<TResult> Take<TInput, TResult>(
    this CepOrderedStream<TInput> source,
    uint numberOfElements,
    Expression<Func<CepRankedEvent<TInput>, TResult>> resultSelector
)

Type Parameters

  • TInput
    Payload type of input events.
  • TResult
    Payload type of output events.

Parameters

  • numberOfElements
    Type: System.UInt32
    Number of elements to take.

Return Value

Type: Microsoft.ComplexEventProcessing.Linq.CepStream<TResult>
A stream that is the result of Take().

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type CepOrderedStream<TInput>. 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.105) or https://msdn.microsoft.com/en-us/library/bb383977(v=sql.105).

Remarks

For more information, see TopK.

See Also

Reference

CepStream Class

Take Overload

Microsoft.ComplexEventProcessing.Linq Namespace