Table of Contents

Method Median

Namespace
MongoDB.Driver.Linq
Assembly
MongoDB.Driver.dll

Median(IEnumerable<decimal>)

Computes the median of a sequence of values.

public static decimal Median(this IEnumerable<decimal> source)

Parameters

source IEnumerable<decimal>

The sequence of values.

Returns

decimal

The median value.

Median(IEnumerable<decimal?>)

Computes the median of a sequence of values.

public static decimal? Median(this IEnumerable<decimal?> source)

Parameters

source IEnumerable<decimal?>

The sequence of values.

Returns

decimal?

The median value.

Median(IEnumerable<double>)

Computes the median of a sequence of values.

public static double Median(this IEnumerable<double> source)

Parameters

source IEnumerable<double>

The sequence of values.

Returns

double

The median value.

Median(IEnumerable<double?>)

Computes the median of a sequence of values.

public static double? Median(this IEnumerable<double?> source)

Parameters

source IEnumerable<double?>

The sequence of values.

Returns

double?

The median value.

Median(IEnumerable<float>)

Computes the median of a sequence of values.

public static float Median(this IEnumerable<float> source)

Parameters

source IEnumerable<float>

The sequence of values.

Returns

float

The median value.

Median(IEnumerable<float?>)

Computes the median of a sequence of values.

public static float? Median(this IEnumerable<float?> source)

Parameters

source IEnumerable<float?>

The sequence of values.

Returns

float?

The median value.

Median(IEnumerable<int>)

Computes the median of a sequence of values.

public static double Median(this IEnumerable<int> source)

Parameters

source IEnumerable<int>

The sequence of values.

Returns

double

The median value.

Median(IEnumerable<int?>)

Computes the median of a sequence of values.

public static double? Median(this IEnumerable<int?> source)

Parameters

source IEnumerable<int?>

The sequence of values.

Returns

double?

The median value.

Median(IEnumerable<long>)

Computes the median of a sequence of values.

public static double Median(this IEnumerable<long> source)

Parameters

source IEnumerable<long>

The sequence of values.

Returns

double

The median value.

Median(IEnumerable<long?>)

Computes the median of a sequence of values.

public static double? Median(this IEnumerable<long?> source)

Parameters

source IEnumerable<long?>

The sequence of values.

Returns

double?

The median value.

Median<TSource>(IEnumerable<TSource>, Func<TSource, decimal>)

Computes the median of a sequence of values.

public static decimal Median<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal> selector)

Parameters

source IEnumerable<TSource>

A sequence of values to calculate the median of.

selector Func<TSource, decimal>

A transform function to apply to each element.

Returns

decimal

The median value.

Type Parameters

TSource

The type of the elements in the source sequence.

Median<TSource>(IEnumerable<TSource>, Func<TSource, decimal?>)

Computes the median of a sequence of values.

public static decimal? Median<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal?> selector)

Parameters

source IEnumerable<TSource>

A sequence of values to calculate the median of.

selector Func<TSource, decimal?>

A transform function to apply to each element.

Returns

decimal?

The median value.

Type Parameters

TSource

The type of the elements in the source sequence.

Median<TSource>(IEnumerable<TSource>, Func<TSource, double>)

Computes the median of a sequence of values.

public static double Median<TSource>(this IEnumerable<TSource> source, Func<TSource, double> selector)

Parameters

source IEnumerable<TSource>

A sequence of values to calculate the median of.

selector Func<TSource, double>

A transform function to apply to each element.

Returns

double

The median value.

Type Parameters

TSource

The type of the elements in the source sequence.

Median<TSource>(IEnumerable<TSource>, Func<TSource, double?>)

Computes the median of a sequence of values.

public static double? Median<TSource>(this IEnumerable<TSource> source, Func<TSource, double?> selector)

Parameters

source IEnumerable<TSource>

A sequence of values to calculate the median of.

selector Func<TSource, double?>

A transform function to apply to each element.

Returns

double?

The median value.

Type Parameters

TSource

The type of the elements in the source sequence.

Median<TSource>(IEnumerable<TSource>, Func<TSource, float>)

Computes the median of a sequence of values.

public static float Median<TSource>(this IEnumerable<TSource> source, Func<TSource, float> selector)

Parameters

source IEnumerable<TSource>

A sequence of values to calculate the median of.

selector Func<TSource, float>

A transform function to apply to each element.

Returns

float

The median value.

Type Parameters

TSource

The type of the elements in the source sequence.

Median<TSource>(IEnumerable<TSource>, Func<TSource, float?>)

Computes the median of a sequence of values.

public static float? Median<TSource>(this IEnumerable<TSource> source, Func<TSource, float?> selector)

Parameters

source IEnumerable<TSource>

A sequence of values to calculate the median of.

selector Func<TSource, float?>

A transform function to apply to each element.

Returns

float?

The median value.

Type Parameters

TSource

The type of the elements in the source sequence.

Median<TSource>(IEnumerable<TSource>, Func<TSource, int>)

Computes the median of a sequence of values.

public static double Median<TSource>(this IEnumerable<TSource> source, Func<TSource, int> selector)

Parameters

source IEnumerable<TSource>

A sequence of values to calculate the median of.

selector Func<TSource, int>

A transform function to apply to each element.

Returns

double

The median value.

Type Parameters

TSource

The type of the elements in the source sequence.

Median<TSource>(IEnumerable<TSource>, Func<TSource, int?>)

Computes the median of a sequence of values.

public static double? Median<TSource>(this IEnumerable<TSource> source, Func<TSource, int?> selector)

Parameters

source IEnumerable<TSource>

A sequence of values to calculate the median of.

selector Func<TSource, int?>

A transform function to apply to each element.

Returns

double?

The median value.

Type Parameters

TSource

The type of the elements in the source sequence.

Median<TSource>(IEnumerable<TSource>, Func<TSource, long>)

Computes the median of a sequence of values.

public static double Median<TSource>(this IEnumerable<TSource> source, Func<TSource, long> selector)

Parameters

source IEnumerable<TSource>

A sequence of values to calculate the median of.

selector Func<TSource, long>

A transform function to apply to each element.

Returns

double

The median value.

Type Parameters

TSource

The type of the elements in the source sequence.

Median<TSource>(IEnumerable<TSource>, Func<TSource, long?>)

Computes the median of a sequence of values.

public static double? Median<TSource>(this IEnumerable<TSource> source, Func<TSource, long?> selector)

Parameters

source IEnumerable<TSource>

A sequence of values to calculate the median of.

selector Func<TSource, long?>

A transform function to apply to each element.

Returns

double?

The median value.

Type Parameters

TSource

The type of the elements in the source sequence.