ListExtensions.Reduce<TItem, TSum>

Extension Method in ListExtensions

Declaration

public static TSum Reduce<TItem, TSum>(this List<TItem> list, TSum initialValue, ListExtensions.Reducer<TSum, TItem> reducer)

Description

Reduces the items of the list to a single value.

Type Parameters

TItemThe type of items in the list.
TSumThe type of the reduced value.

Parameters

listThe list to reduce.
initialValueThe initial value to use.
reducerThe reducer to use.

Returns

TThe reduced value.