AsyncEnumerableExtensionsAverageAsync(IAsyncEnumerableNullableUBinarySize, CancellationToken) Method
Asynchronously computes the average of a sequence of nullable
UBinarySize
values.
Namespace: OokiiAssembly: Ookii.BinarySize.Async (in Ookii.BinarySize.Async.dll) Version: 1.2.0+20f0bdf981c7baf115c68ccab612b1a031efcb4d
public static ValueTask<UBinarySize?> AverageAsync(
this IAsyncEnumerable<UBinarySize?> source,
CancellationToken cancellationToken = default
)
<ExtensionAttribute>
Public Shared Function AverageAsync (
source As IAsyncEnumerable(Of UBinarySize?),
Optional cancellationToken As CancellationToken = Nothing
) As ValueTask(Of UBinarySize?)
public:
[ExtensionAttribute]
static ValueTask<Nullable<UBinarySize>> AverageAsync(
IAsyncEnumerable<Nullable<UBinarySize>>^ source,
CancellationToken cancellationToken = CancellationToken()
)
[<ExtensionAttribute>]
static member AverageAsync :
source : IAsyncEnumerable<Nullable<UBinarySize>> *
?cancellationToken : CancellationToken
(* Defaults:
let _cancellationToken = defaultArg cancellationToken new CancellationToken()
*)
-> ValueTask<Nullable<UBinarySize>>
- source IAsyncEnumerableNullableUBinarySize
-
A sequence of nullable UBinarySize values to calculate the average of.
- cancellationToken CancellationToken (Optional)
-
The optional cancellation token to be used for canceling the sequence at any time.
ValueTaskNullableUBinarySize
A task that represents the asynchronous operation. The result of the task is the average of
the values in the sequence, or
if
source is empty
or contains only values that are
.
In Visual Basic and C#, you can call this method as an instance method on any object of type
IAsyncEnumerableNullableUBinarySize. 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).