DataSource for Entity Framework in WPF
C1.LiveLinq Namespace / LiveViewExtensions Class / LiveAggregate Method / LiveAggregate<TSource,TAccumulate,TResult>(View<TSource>,TAccumulate,Expression<Func<TAccumulate,TSource,TAccumulate>>,Expression<Func<TAccumulate,TSource,TAccumulate>>,Expression<Func<TAccumulate,TSource,Boolean>>,Expression<Func<TAccumulate,TResult>>) Method
The type of the elements of source.
The type of the accumulator value.
The type of the resulting value.
A view to aggregate over.
The initial accumulator value.
An accumulator function to be invoked on each element that is added to the source view.
A function to be applied to the accumulated value and to an element to obtain the changed accumulated value, when an element is removed from the source view.
A function used to determine whether funcRemove must be applied when an element is removed from the source view, or the accumulated value is not affected by its removal.
A function to transform the final accumulator value into the result value.

In This Topic
    LiveAggregate<TSource,TAccumulate,TResult>(View<TSource>,TAccumulate,Expression<Func<TAccumulate,TSource,TAccumulate>>,Expression<Func<TAccumulate,TSource,TAccumulate>>,Expression<Func<TAccumulate,TSource,Boolean>>,Expression<Func<TAccumulate,TResult>>) Method
    In This Topic
    Applies an accumulator function over a view. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value.
    Syntax

    Parameters

    source
    A view to aggregate over.
    seed
    The initial accumulator value.
    funcAdd
    An accumulator function to be invoked on each element that is added to the source view.
    funcRemove
    A function to be applied to the accumulated value and to an element to obtain the changed accumulated value, when an element is removed from the source view.
    funcRemoveDefined
    A function used to determine whether funcRemove must be applied when an element is removed from the source view, or the accumulated value is not affected by its removal.
    resultSelector
    A function to transform the final accumulator value into the result value.

    Type Parameters

    TSource
    The type of the elements of source.
    TAccumulate
    The type of the accumulator value.
    TResult
    The type of the resulting value.

    Return Value

    A view representing the final accumulator value.
    Remarks
    It is possible to use standard LINQ query operator Aggregate instead of LiveAggregate. Both are "live" in the sense that they are recomputed automatically when any change occurs in the source. The difference is that Aggregate will every time loop through the entire source collection and aggregate it from scratch, whereas LiveAggregate will use a more performant algorithm, will maintain its value incrementally, processing only those source items that actually changed.
    See Also