AFAggregate.SummaryAsync(T) Method (IEnumerable(T), String, AFSummaryTypes, CancellationToken)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Summarizes the specified items asynchronously.
Namespace: OSIsoft.AF.Data.Aggregate
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static Task<AFSummaryResult> SummaryAsync<T>( this IEnumerable<T> items, string field, AFSummaryTypes summaryTypes, CancellationToken cancellationToken ) where T : AFObject
<ExtensionAttribute> Public Shared Function SummaryAsync(Of T As AFObject) ( items As IEnumerable(Of T), field As String, summaryTypes As AFSummaryTypes, cancellationToken As CancellationToken ) As Task(Of AFSummaryResult) Dim items As IEnumerable(Of T) Dim field As String Dim summaryTypes As AFSummaryTypes Dim cancellationToken As CancellationToken Dim returnValue As Task(Of AFSummaryResult) returnValue = items.SummaryAsync(field, summaryTypes, cancellationToken)
public: [ExtensionAttribute] generic<typename T> where T : AFObject static Task<AFSummaryResult^>^ SummaryAsync( IEnumerable<T>^ items, String^ field, AFSummaryTypes summaryTypes, CancellationToken cancellationToken )
[<ExtensionAttribute>] static member SummaryAsync : items : IEnumerable<'T> * field : string * summaryTypes : AFSummaryTypes * cancellationToken : CancellationToken -> Task<AFSummaryResult> when 'T : AFObject
Parameters
- items
- Type: System.Collections.GenericIEnumerableT
The items that should be summarized. - field
- Type: SystemString
The field that should be summarized. - summaryTypes
- Type: OSIsoft.AF.DataAFSummaryTypes
The summaries that should be performed on the field. - cancellationToken
- Type: System.ThreadingCancellationToken
A token to control cancellation of the aggregation request.
Type Parameters
- T
- The type of items to summarize
Return Value
Type: TaskAFSummaryResultA result containing the requested summaries or an error if the summaries could not be performed.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
| This call might use a background task to complete some of its work. See the Threading Overview for some matters to consider when execution transitions to another thread. |