Table of Contents

Class AggregateDefinition<T>

Namespace
MudBlazor
Assembly
MudBlazor.dll

Represents a function which calculates aggregate values such as counts, sums, averages, and custom functions.

public class AggregateDefinition<T>

Type Parameters

T

The type of object to aggregate.

Inheritance
AggregateDefinition<T>
Inherited Members
Extension Methods

Constructors

AggregateDefinition()

public AggregateDefinition()

Properties

Culture

An object that supplies culture-specific formatting information.

public CultureInfo? Culture { get; set; }

Property Value

CultureInfo

Remarks

Defaults to null.

CustomAggregate

The custom function used to calculate aggregate values.

public Func<IEnumerable<T>, string>? CustomAggregate { get; set; }

Property Value

Func<IEnumerable<T>, string>

Remarks

This function is used when Type is Custom.

DisplayFormat

The format used to display aggregate values with prepended or appended text.

public string DisplayFormat { get; set; }

Property Value

string

Remarks

Defaults to {value}.

NumberFormat

A numeric format string.

public string? NumberFormat { get; set; }

Property Value

string

Remarks

Defaults to null.

Type

The type of aggregate calculation to perform.

public AggregateType Type { get; set; }

Property Value

AggregateType

Remarks

Defaults to Count. When Custom, the function defined in CustomAggregate is used.

Methods

GetValue(LambdaExpression?, IEnumerable<T>?)

Calculates the aggregate value to display.

public string GetValue(LambdaExpression? propertyExpression, IEnumerable<T>? items)

Parameters

propertyExpression LambdaExpression

The expression which calculates the aggregate.

items IEnumerable<T>

The items involved in the aggregate calculation.

Returns

string

The calculated aggregate value formatted using DisplayFormat.

SimpleAvg()

Represents a basic average aggregate calculation.

public static AggregateDefinition<T> SimpleAvg()

Returns

AggregateDefinition<T>

An aggregate definition with a Type of Avg and a DisplayFormat of Average {value}.

SimpleAvg(string?, CultureInfo?)

Represents a basic average aggregate calculation with custom format.

public static AggregateDefinition<T> SimpleAvg(string? numberFormat, CultureInfo? culture = null)

Parameters

numberFormat string

A numeric format string.

culture CultureInfo

An object that supplies culture-specific formatting information.

Returns

AggregateDefinition<T>

An aggregate definition with a Type of Avg and a DisplayFormat of Average {value}.

SimpleCount()

Represents a basic count aggregate calculation.

public static AggregateDefinition<T> SimpleCount()

Returns

AggregateDefinition<T>

An aggregate definition with a Type of Count and a DisplayFormat of Total {value}.

SimpleCount(string?, CultureInfo?)

Represents a basic count aggregate calculation with custom format.

public static AggregateDefinition<T> SimpleCount(string? numberFormat, CultureInfo? culture = null)

Parameters

numberFormat string

A numeric format string.

culture CultureInfo

An object that supplies culture-specific formatting information.

Returns

AggregateDefinition<T>

An aggregate definition with a Type of Count and a DisplayFormat of Total {value}.

SimpleMax()

Represents a basic maximum aggregate calculation.

public static AggregateDefinition<T> SimpleMax()

Returns

AggregateDefinition<T>

An aggregate definition with a Type of Max and a DisplayFormat of Max {value}.

SimpleMax(string?, CultureInfo?)

Represents a basic maximum aggregate calculation with custom format.

public static AggregateDefinition<T> SimpleMax(string? numberFormat, CultureInfo? culture = null)

Parameters

numberFormat string
culture CultureInfo

Returns

AggregateDefinition<T>
A numeric format string. An object that supplies culture-specific formatting information./// /// An aggregate definition with a Type of Max and a DisplayFormat of Max {value}.

SimpleMin()

Represents a basic minimum aggregate calculation.

public static AggregateDefinition<T> SimpleMin()

Returns

AggregateDefinition<T>

An aggregate definition with a Type of Min and a DisplayFormat of Min {value}.

SimpleMin(string?, CultureInfo?)

Represents a basic minimum aggregate calculation with custom format.

public static AggregateDefinition<T> SimpleMin(string? numberFormat, CultureInfo? culture = null)

Parameters

numberFormat string
culture CultureInfo

Returns

AggregateDefinition<T>
A numeric format string. An object that supplies culture-specific formatting information./// /// An aggregate definition with a Type of Min and a DisplayFormat of Min {value}.

SimpleSum()

Represents a basic sum aggregate calculation.

public static AggregateDefinition<T> SimpleSum()

Returns

AggregateDefinition<T>

An aggregate definition with a Type of Sum and a DisplayFormat of Sum {value}.

SimpleSum(string?, CultureInfo?)

Represents a basic sum aggregate calculation with custom format.

public static AggregateDefinition<T> SimpleSum(string? numberFormat, CultureInfo? culture = null)

Parameters

numberFormat string
culture CultureInfo

Returns

AggregateDefinition<T>
A numeric format string. An object that supplies culture-specific formatting information./// /// /// An aggregate definition with a Type of Sum and a DisplayFormat of Sum {value}.

See Also