EnumerableExtensionsSumTSource(IEnumerableTSource, FuncTSource, BinarySize) Method
Computes the sum of a sequence of
BinarySize values that are obtained by
invoking a transform function on each element of the input sequence.
Namespace: OokiiAssembly: Ookii.BinarySize (in Ookii.BinarySize.dll) Version: 1.0.0+877c9712c6435bf9adfdb0683d7a434c5604a8f2
public static BinarySize Sum<TSource>(
this IEnumerable<TSource> source,
Func<TSource, BinarySize> selector
)
<ExtensionAttribute>
Public Shared Function Sum(Of TSource) (
source As IEnumerable(Of TSource),
selector As Func(Of TSource, BinarySize)
) As BinarySize
public:
[ExtensionAttribute]
generic<typename TSource>
static BinarySize Sum(
IEnumerable<TSource>^ source,
Func<TSource, BinarySize>^ selector
)
[<ExtensionAttribute>]
static member Sum :
source : IEnumerable<'TSource> *
selector : Func<'TSource, BinarySize> -> BinarySize
- source IEnumerableTSource
-
A sequence of values to calculate the sum of.
- selector FuncTSource, BinarySize
- A transform function to apply to each element.
- TSource
- The type of the elements of source.
BinarySizeThe sum of the values in the sequence.In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableTSource. 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).
This method returns zero if source contains no elements.