Table of Contents

Class ObservableExtensions

Namespace
NMF.Expressions.Linq
Assembly
NMF.Expressions.Linq.dll

Defines a set of extension methods on the INotifyValue monad

public static class ObservableExtensions
Inheritance
ObservableExtensions
Inherited Members

Properties

KeepOrder

Gets or sets a global flag indicating whether projections and filters should maintain the element order

public static bool KeepOrder { get; set; }

Property Value

bool

Methods

All<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, bool>>)

Gets a value indicating whether all items in the given collection match the given predicate

[ObservableProxy(typeof(ObservableAll<>), "Create", false)]
public static bool All<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, bool>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, bool>>

A custom predicate that is applied to all items in the collection

Returns

bool

True, if all items in the collection match the given predicate

Type Parameters

TSource

The type of the elements in the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Any<TSource>(INotifyEnumerable<TSource>)

Gets a value indicating whether there is any item in the source collection

[ObservableProxy(typeof(ObservableAny<>), "Create", false)]
public static bool Any<TSource>(this INotifyEnumerable<TSource> source)

Parameters

source INotifyEnumerable<TSource>

The source collection

Returns

bool

True, if the collection has an item, otherwise false

Type Parameters

TSource

The type of the elements in the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Any<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, bool>>)

Gets a value indicating whether there is any item in the source collection that matches the given predicate

[ObservableProxy(typeof(ObservableLambdaAny<>), "Create", false)]
public static bool Any<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, bool>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, bool>>

A custom predicate that is checked for every item

Returns

bool

True, if there is an item that matches the givn criteria, otherwise false

Type Parameters

TSource

The type of the elements in the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average(INotifyEnumerable<decimal>)

Gets the average of the given collection of numbers

[ObservableProxy(typeof(ObservableDecimalAverage), "Create", false)]
public static decimal Average(this INotifyEnumerable<decimal> source)

Parameters

source INotifyEnumerable<decimal>

A collection of numbers

Returns

decimal

The average of the given collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average(INotifyEnumerable<double>)

Gets the average of the given collection of numbers

[ObservableProxy(typeof(ObservableDoubleAverage), "Create", false)]
public static double Average(this INotifyEnumerable<double> source)

Parameters

source INotifyEnumerable<double>

A collection of numbers

Returns

double

The average of the given collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average(INotifyEnumerable<int>)

Gets the average of the given collection of numbers

[ObservableProxy(typeof(ObservableIntAverage), "Create", false)]
public static double Average(this INotifyEnumerable<int> source)

Parameters

source INotifyEnumerable<int>

A collection of numbers

Returns

double

The average of the given collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average(INotifyEnumerable<long>)

Gets the average of the given collection of numbers

[ObservableProxy(typeof(ObservableLongAverage), "Create", false)]
public static double Average(this INotifyEnumerable<long> source)

Parameters

source INotifyEnumerable<long>

A collection of numbers

Returns

double

The average of the given collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average(INotifyEnumerable<decimal?>)

Gets the average of the given collection of numbers

[ObservableProxy(typeof(ObservableNullableDecimalAverage), "Create", false)]
public static decimal? Average(this INotifyEnumerable<decimal?> source)

Parameters

source INotifyEnumerable<decimal?>

A collection of numbers

Returns

decimal?

The average of the given collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average(INotifyEnumerable<double?>)

Gets the average of the given collection of numbers

[ObservableProxy(typeof(ObservableNullableDoubleAverage), "Create", false)]
public static double? Average(this INotifyEnumerable<double?> source)

Parameters

source INotifyEnumerable<double?>

A collection of numbers

Returns

double?

The average of the given collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average(INotifyEnumerable<int?>)

Gets the average of the given collection of numbers

[ObservableProxy(typeof(ObservableNullableIntAverage), "Create", false)]
public static double? Average(this INotifyEnumerable<int?> source)

Parameters

source INotifyEnumerable<int?>

A collection of numbers

Returns

double?

The average of the given collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average(INotifyEnumerable<long?>)

Gets the average of the given collection of numbers

[ObservableProxy(typeof(ObservableNullableLongAverage), "Create", false)]
public static double? Average(this INotifyEnumerable<long?> source)

Parameters

source INotifyEnumerable<long?>

A collection of numbers

Returns

double?

The average of the given collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average(INotifyEnumerable<float?>)

Gets the average of the given collection of numbers

[ObservableProxy(typeof(ObservableNullableFloatAverage), "Create", false)]
public static float? Average(this INotifyEnumerable<float?> source)

Parameters

source INotifyEnumerable<float?>

A collection of numbers

Returns

float?

The average of the given collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average(INotifyEnumerable<float>)

Gets the average of the given collection of numbers

[ObservableProxy(typeof(ObservableFloatAverage), "Create", false)]
public static float Average(this INotifyEnumerable<float> source)

Parameters

source INotifyEnumerable<float>

A collection of numbers

Returns

float

The average of the given collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, decimal>>)

Gets the average of the given feature based on items of the given collection

[ObservableProxy(typeof(ObservableAverage), "CreateDecimal", false)]
public static decimal Average<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, decimal>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, decimal>>

The feature of the source items that should be averaged

Returns

decimal

Type Parameters

TSource

The type of the items in the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, double>>)

Gets the average of the given feature based on items of the given collection

[ObservableProxy(typeof(ObservableAverage), "CreateDouble", false)]
public static double Average<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, double>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, double>>

The feature of the source items that should be averaged

Returns

double

Type Parameters

TSource

The type of the items in the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, int>>)

Gets the average of the given feature based on items of the given collection

[ObservableProxy(typeof(ObservableAverage), "CreateInt", false)]
public static double Average<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, int>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, int>>

The feature of the source items that should be averaged

Returns

double

Type Parameters

TSource

The type of the items in the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, long>>)

Gets the average of the given feature based on items of the given collection

[ObservableProxy(typeof(ObservableAverage), "CreateLong", false)]
public static double Average<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, long>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, long>>

The feature of the source items that should be averaged

Returns

double

Type Parameters

TSource

The type of the items in the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, decimal?>>)

Gets the average of the given feature based on items of the given collection

[ObservableProxy(typeof(ObservableAverage), "CreateNullableDecimal", false)]
public static decimal? Average<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, decimal?>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, decimal?>>

The feature of the source items that should be averaged

Returns

decimal?

Type Parameters

TSource

The type of the items in the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, double?>>)

Gets the average of the given feature based on items of the given collection

[ObservableProxy(typeof(ObservableAverage), "CreateNullableDouble", false)]
public static double? Average<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, double?>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, double?>>

The feature of the source items that should be averaged

Returns

double?

Type Parameters

TSource

The type of the items in the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, int?>>)

Gets the average of the given feature based on items of the given collection

[ObservableProxy(typeof(ObservableAverage), "CreateNullableInt", false)]
public static double? Average<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, int?>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, int?>>

The feature of the source items that should be averaged

Returns

double?

Type Parameters

TSource

The type of the items in the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, long?>>)

Gets the average of the given feature based on items of the given collection

[ObservableProxy(typeof(ObservableAverage), "CreateNullableLong", false)]
public static double? Average<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, long?>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, long?>>

The feature of the source items that should be averaged

Returns

double?

Type Parameters

TSource

The type of the items in the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, float?>>)

Gets the average of the given feature based on items of the given collection

[ObservableProxy(typeof(ObservableAverage), "CreateNullableFloat", false)]
public static float? Average<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, float?>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, float?>>

The feature of the source items that should be averaged

Returns

float?

Type Parameters

TSource

The type of the items in the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Average<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, float>>)

Gets the average of the given feature based on items of the given collection

[ObservableProxy(typeof(ObservableAverage), "CreateFloat", false)]
public static float Average<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, float>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, float>>

The feature of the source items that should be averaged

Returns

float

Type Parameters

TSource

The type of the items in the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Cast<TResult>(INotifyEnumerable)

Casts the given notifying enumerable to the given type

public static INotifyEnumerable<TResult> Cast<TResult>(this INotifyEnumerable source)

Parameters

source INotifyEnumerable

The source collection

Returns

INotifyEnumerable<TResult>

A notifying collection casted to the given type

Type Parameters

TResult

The true type of the items in the collection

Remarks

If any item in the source collection is not of type TResult, an exception is thrown. Consider using OfType<TResult>(INotifyEnumerable) in this scenario.

Concat<TSource>(INotifyEnumerable<TSource>, IEnumerable<TSource>)

Concats the given notifying enumerables

public static INotifyEnumerable<TSource> Concat<TSource>(this INotifyEnumerable<TSource> source, IEnumerable<TSource> source2)

Parameters

source INotifyEnumerable<TSource>

The first source

source2 IEnumerable<TSource>

The second source

Returns

INotifyEnumerable<TSource>

The concatenation of both sources

Type Parameters

TSource

The type of the items

Remarks

The second collection does not have to be a notifying collection, but if it is not, it must not change its contents.

Contains<TSource>(INotifyEnumerable<TSource>, TSource)

Searches the given collection for the given item

[ObservableProxy(typeof(ObservableContains<>), "Create", false)]
public static bool Contains<TSource>(this INotifyEnumerable<TSource> source, TSource item)

Parameters

source INotifyEnumerable<TSource>

The source collection

item TSource

The item that needs to be checked

Returns

bool

True, if the given source collection contains the provided item, otherwise false

Type Parameters

TSource

The element type of the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Contains<TSource>(INotifyEnumerable<TSource>, TSource, IEqualityComparer<TSource>)

Searches the given collection for the given item

[ObservableProxy(typeof(ObservableContains<>), "CreateWithComparer", false)]
public static bool Contains<TSource>(this INotifyEnumerable<TSource> source, TSource item, IEqualityComparer<TSource> comparer)

Parameters

source INotifyEnumerable<TSource>

The source collection

item TSource

The item that needs to be checked

comparer IEqualityComparer<TSource>

The equality comparer to decide whether items are equal. Can be omitted

Returns

bool

True, if the given source collection contains the provided item, otherwise false

Type Parameters

TSource

The element type of the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Count<TSource>(INotifyEnumerable<TSource>)

Returns how many items are in the source collection

[ObservableProxy(typeof(ObservableCount<>), "Create", false)]
public static int Count<TSource>(this INotifyEnumerable<TSource> source)

Parameters

source INotifyEnumerable<TSource>

The source collection

Returns

int

The amount of elements in the source collection

Type Parameters

TSource

The type of elements within the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Count<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, bool>>)

Returns how many items are in the source collection that match the given predicate

[ObservableProxy(typeof(ObservableCount<>), "CreateWithComparer", false)]
public static int Count<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, bool>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, bool>>

The predicate that is to be checked for each item

Returns

int

The amount of elements in the source collection that match the given predicate

Type Parameters

TSource

The type of elements within the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Distinct<TSource>(INotifyEnumerable<TSource>)

Eliminates duplicates from the given collection

public static INotifyEnumerable<TSource> Distinct<TSource>(this INotifyEnumerable<TSource> source)

Parameters

source INotifyEnumerable<TSource>

The source collection

Returns

INotifyEnumerable<TSource>

A notifying collection with no duplicates

Type Parameters

TSource

The element type of the source collection

Remarks

This method destroys the original order of the items

Distinct<TSource>(INotifyEnumerable<TSource>, IEqualityComparer<TSource>)

Eliminates duplicates from the given collection

public static INotifyEnumerable<TSource> Distinct<TSource>(this INotifyEnumerable<TSource> source, IEqualityComparer<TSource> comparer)

Parameters

source INotifyEnumerable<TSource>

The source collection

comparer IEqualityComparer<TSource>

The comparer to decide whether items match

Returns

INotifyEnumerable<TSource>

A notifying collection with no duplicates

Type Parameters

TSource

The element type of the source collection

Remarks

This method destroys the original order of the items

Except<TSource>(INotifyEnumerable<TSource>, IEnumerable<TSource>)

Returns the given source collection without the elements from the second collection

public static INotifyEnumerable<TSource> Except<TSource>(this INotifyEnumerable<TSource> source, IEnumerable<TSource> exceptions)

Parameters

source INotifyEnumerable<TSource>

The source collection

exceptions IEnumerable<TSource>

The exceptions. Can be a static collection, but in that case must not change

Returns

INotifyEnumerable<TSource>

The source collection without the exceptions

Type Parameters

TSource

The type of the items

Remarks

If the exceptions collection will ever change, it must implement INotifyCollectionChanged, otherwise the implementation will get corrupted.

Except<TSource>(INotifyEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

Returns the given source collection without the elements from the second collection

public static INotifyEnumerable<TSource> Except<TSource>(this INotifyEnumerable<TSource> source, IEnumerable<TSource> exceptions, IEqualityComparer<TSource> comparer)

Parameters

source INotifyEnumerable<TSource>

The source collection

exceptions IEnumerable<TSource>

The exceptions. Can be a static collection, but in that case must not change

comparer IEqualityComparer<TSource>

A comparer to decide whether two items match

Returns

INotifyEnumerable<TSource>

The source collection without the exceptions

Type Parameters

TSource

The type of the items

Remarks

If the exceptions collection will ever change, it must implement INotifyCollectionChanged, otherwise the implementation will get corrupted.

FirstOrDefault<TSource>(INotifyEnumerable<TSource>)

Gets the first item of the given source collection or the item type default value, if the collection is empty

[ObservableProxy(typeof(ObservableFirstOrDefault<>), "Create", false)]
[SetExpressionRewriter(typeof(ObservableFirstOrDefault<>), "CreateSetExpression")]
public static TSource FirstOrDefault<TSource>(this INotifyEnumerable<TSource> source)

Parameters

source INotifyEnumerable<TSource>

The source collection

Returns

TSource

The first item of the collection or the type default value, if the collection is empty

Type Parameters

TSource

The element type of the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

FirstOrDefault<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, bool>>)

Gets the first item of the given source collection that matches the given predicate or the item type default value, if the collection is empty or no item matches the given predicate

[ObservableProxy(typeof(ObservableFirstOrDefault<>), "CreateForPredicate", false)]
[SetExpressionRewriter(typeof(ObservableFirstOrDefault<>), "CreateSetExpressionWithPredicate")]
public static TSource FirstOrDefault<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, bool>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, bool>>

The filter predicate

Returns

TSource

The first item of the collection that matches the predicate or the type default value

Type Parameters

TSource

The element type of the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

GroupBy<TSource, TKey>(INotifyEnumerable<TSource>, Expression<Func<TSource, TKey>>)

Groups the given collection by the given predicate

public static INotifyEnumerable<INotifyGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TKey>> keySelector)

Parameters

source INotifyEnumerable<TSource>

The source collection

keySelector Expression<Func<TSource, TKey>>

The predicate expression selecting the keys for grouping

Returns

INotifyEnumerable<INotifyGrouping<TKey, TSource>>

A collection of groups

Type Parameters

TSource

The element type of the source collection

TKey

The type of keys used for grouping

GroupBy<TSource, TKey>(INotifyEnumerable<TSource>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>)

Groups the given collection by the given predicate

public static INotifyEnumerable<INotifyGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)

Parameters

source INotifyEnumerable<TSource>

The source collection

keySelector Expression<Func<TSource, TKey>>

The predicate expression selecting the keys for grouping

comparer IEqualityComparer<TKey>

A comparer that decides whether items are identical

Returns

INotifyEnumerable<INotifyGrouping<TKey, TSource>>

A collection of groups

Type Parameters

TSource

The element type of the source collection

TKey

The type of keys used for grouping

GroupBy<TSource, TKey>(INotifyEnumerable<TSource>, Expression<Func<TSource, TKey>>, Func<TSource, TKey>)

Groups the given collection by the given predicate

public static INotifyEnumerable<INotifyGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Func<TSource, TKey> keySelectorCompiled)

Parameters

source INotifyEnumerable<TSource>

The source collection

keySelector Expression<Func<TSource, TKey>>

The predicate expression selecting the keys for grouping

keySelectorCompiled Func<TSource, TKey>

A compiled version of keySelector

Returns

INotifyEnumerable<INotifyGrouping<TKey, TSource>>

A collection of groups

Type Parameters

TSource

The element type of the source collection

TKey

The type of keys used for grouping

GroupBy<TSource, TKey>(INotifyEnumerable<TSource>, Expression<Func<TSource, TKey>>, Func<TSource, TKey>, IEqualityComparer<TKey>)

Groups the given collection by the given predicate

public static INotifyEnumerable<INotifyGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Func<TSource, TKey> keySelectorCompiled, IEqualityComparer<TKey> comparer)

Parameters

source INotifyEnumerable<TSource>

The source collection

keySelector Expression<Func<TSource, TKey>>

The predicate expression selecting the keys for grouping

keySelectorCompiled Func<TSource, TKey>

A compiled version of keySelector

comparer IEqualityComparer<TKey>

A comparer that decides whether items are identical

Returns

INotifyEnumerable<INotifyGrouping<TKey, TSource>>

A collection of groups

Type Parameters

TSource

The element type of the source collection

TKey

The type of keys used for grouping

GroupBy<TSource, TKey, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, TKey>>, Func<TSource, TKey>, Expression<Func<TKey, IEnumerable<TSource>, TResult>>, Func<TKey, IEnumerable<TSource>, TResult>)

Groups the given collection by the given predicate into the given result

public static INotifyEnumerable<TResult> GroupBy<TSource, TKey, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Func<TSource, TKey> keySelectorCompiled, Expression<Func<TKey, IEnumerable<TSource>, TResult>> resultSelector, Func<TKey, IEnumerable<TSource>, TResult> resultSelectorCompiled)

Parameters

source INotifyEnumerable<TSource>

The source collection

keySelector Expression<Func<TSource, TKey>>

The predicate expression selecting the keys for grouping

keySelectorCompiled Func<TSource, TKey>

A compiled version of keySelector

resultSelector Expression<Func<TKey, IEnumerable<TSource>, TResult>>

A function to get the result element for a group

resultSelectorCompiled Func<TKey, IEnumerable<TSource>, TResult>

A compiled version of resultSelector

Returns

INotifyEnumerable<TResult>

A collection of groups

Type Parameters

TSource

The element type of the source collection

TKey

The type of keys used for grouping

TResult

The type of the result

GroupBy<TSource, TKey, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, TKey>>, Func<TSource, TKey>, Expression<Func<TKey, IEnumerable<TSource>, TResult>>, Func<TKey, IEnumerable<TSource>, TResult>, IEqualityComparer<TKey>)

Groups the given collection by the given predicate into the given result

public static INotifyEnumerable<TResult> GroupBy<TSource, TKey, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Func<TSource, TKey> keySelectorCompiled, Expression<Func<TKey, IEnumerable<TSource>, TResult>> resultSelector, Func<TKey, IEnumerable<TSource>, TResult> resultSelectorCompiled, IEqualityComparer<TKey> comparer)

Parameters

source INotifyEnumerable<TSource>

The source collection

keySelector Expression<Func<TSource, TKey>>

The predicate expression selecting the keys for grouping

keySelectorCompiled Func<TSource, TKey>

A compiled version of keySelector

resultSelector Expression<Func<TKey, IEnumerable<TSource>, TResult>>

A function to get the result element for a group

resultSelectorCompiled Func<TKey, IEnumerable<TSource>, TResult>

A compiled version of resultSelector

comparer IEqualityComparer<TKey>

A comparer that decides whether items are identical

Returns

INotifyEnumerable<TResult>

A collection of groups

Type Parameters

TSource

The element type of the source collection

TKey

The type of keys used for grouping

TResult

The type of the result

GroupBy<TSource, TKey, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TKey, IEnumerable<TSource>, TResult>>)

Groups the given collection by the given predicate into the given result

public static INotifyEnumerable<TResult> GroupBy<TSource, TKey, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TKey, IEnumerable<TSource>, TResult>> resultSelector)

Parameters

source INotifyEnumerable<TSource>

The source collection

keySelector Expression<Func<TSource, TKey>>

The predicate expression selecting the keys for grouping

resultSelector Expression<Func<TKey, IEnumerable<TSource>, TResult>>

A function to get the result element for a group

Returns

INotifyEnumerable<TResult>

A collection of groups

Type Parameters

TSource

The element type of the source collection

TKey

The type of keys used for grouping

TResult

The type of the result

GroupBy<TSource, TKey, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TKey, IEnumerable<TSource>, TResult>>, IEqualityComparer<TKey>)

Groups the given collection by the given predicate into the given result

public static INotifyEnumerable<TResult> GroupBy<TSource, TKey, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TKey, IEnumerable<TSource>, TResult>> resultSelector, IEqualityComparer<TKey> comparer)

Parameters

source INotifyEnumerable<TSource>

The source collection

keySelector Expression<Func<TSource, TKey>>

The predicate expression selecting the keys for grouping

resultSelector Expression<Func<TKey, IEnumerable<TSource>, TResult>>

A function to get the result element for a group

comparer IEqualityComparer<TKey>

A comparer that decides whether items are identical

Returns

INotifyEnumerable<TResult>

A collection of groups

Type Parameters

TSource

The element type of the source collection

TKey

The type of keys used for grouping

TResult

The type of the result

GroupJoin<TOuter, TInner, TKey, TResult>(INotifyEnumerable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, IEnumerable<TInner>, TResult>>)

Joins the given collections based on keys into groups

public static INotifyEnumerable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this INotifyEnumerable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, IEnumerable<TInner>, TResult>> resultSelector)

Parameters

outer INotifyEnumerable<TOuter>

The outer collection

inner IEnumerable<TInner>

The inner collection

outerKeySelector Expression<Func<TOuter, TKey>>

A predicate that returns the key for each outer item

innerKeySelector Expression<Func<TInner, TKey>>

A predicate that returns the key for each inner item

resultSelector Expression<Func<TOuter, IEnumerable<TInner>, TResult>>

A function that creates a result for each group of an outer item and a group of inner items

Returns

INotifyEnumerable<TResult>

A collection of grouped results

Type Parameters

TOuter

The element type of the outer collection

TInner

The element type of the inner collection

TKey

The key type to be matched

TResult

The resulting type

GroupJoin<TOuter, TInner, TKey, TResult>(INotifyEnumerable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, IEnumerable<TInner>, TResult>>, IEqualityComparer<TKey>)

Joins the given collections based on keys into groups

public static INotifyEnumerable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this INotifyEnumerable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, IEnumerable<TInner>, TResult>> resultSelector, IEqualityComparer<TKey> comparer)

Parameters

outer INotifyEnumerable<TOuter>

The outer collection

inner IEnumerable<TInner>

The inner collection

outerKeySelector Expression<Func<TOuter, TKey>>

A predicate that returns the key for each outer item

innerKeySelector Expression<Func<TInner, TKey>>

A predicate that returns the key for each inner item

resultSelector Expression<Func<TOuter, IEnumerable<TInner>, TResult>>

A function that creates a result for each group of an outer item and a group of inner items

comparer IEqualityComparer<TKey>

A comparer to decide when two items are equal

Returns

INotifyEnumerable<TResult>

A collection of grouped results

Type Parameters

TOuter

The element type of the outer collection

TInner

The element type of the inner collection

TKey

The key type to be matched

TResult

The resulting type

Intersect<TSource>(INotifyEnumerable<TSource>, IEnumerable<TSource>)

Intersects two collections

public static INotifyEnumerable<TSource> Intersect<TSource>(this INotifyEnumerable<TSource> source, IEnumerable<TSource> source2)

Parameters

source INotifyEnumerable<TSource>

The first collection

source2 IEnumerable<TSource>

The second collection

Returns

INotifyEnumerable<TSource>

The intersection of both collections

Type Parameters

TSource

The element type of the collections

Remarks

No deduplication is done

Intersect<TSource>(INotifyEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

Intersects two collections

public static INotifyEnumerable<TSource> Intersect<TSource>(this INotifyEnumerable<TSource> source, IEnumerable<TSource> source2, IEqualityComparer<TSource> comparer)

Parameters

source INotifyEnumerable<TSource>

The first collection

source2 IEnumerable<TSource>

The second collection

comparer IEqualityComparer<TSource>

A comparer to decide when two items are equal

Returns

INotifyEnumerable<TSource>

The intersection of both collections

Type Parameters

TSource

The element type of the collections

Remarks

No deduplication is done

IsProperSubsetOf<T>(INotifyEnumerable<T>, IEnumerable<T>)

Gets a value indicating whether the given collection is a proper subset of the current collection

[ObservableProxy(typeof(ObservableProperSubsetOf<>), "Create", false)]
public static bool IsProperSubsetOf<T>(this INotifyEnumerable<T> source, IEnumerable<T> other)

Parameters

source INotifyEnumerable<T>

The source collection

other IEnumerable<T>

The collection that is compared to

Returns

bool

True, if all elements of the current collection are contained in the given collection but not inverse, otherwise False

Type Parameters

T

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

IsProperSubsetOf<T>(INotifyEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>)

Gets a value indicating whether the given collection is a proper subset of the current collection

[ObservableProxy(typeof(ObservableProperSubsetOf<>), "CreateWithComparer", false)]
public static bool IsProperSubsetOf<T>(this INotifyEnumerable<T> source, IEnumerable<T> other, IEqualityComparer<T> comparer)

Parameters

source INotifyEnumerable<T>

The source collection

other IEnumerable<T>

The collection that is compared to

comparer IEqualityComparer<T>

The comparer to define equality

Returns

bool

True, if all elements of the current collection are contained in the given collection but not inverse, otherwise False

Type Parameters

T

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

IsProperSupersetOf<T>(INotifyEnumerable<T>, IEnumerable<T>)

Gets a value indicating whether the given collection is a proper superset of the current collection

[ObservableProxy(typeof(ObservableProperSupersetOf<>), "Create", false)]
public static bool IsProperSupersetOf<T>(this INotifyEnumerable<T> source, IEnumerable<T> other)

Parameters

source INotifyEnumerable<T>

The source collection

other IEnumerable<T>

The collection that is compared to

Returns

bool

True, if all elements of the given collection are contained in the current collection but not inverse, otherwise False

Type Parameters

T

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

IsProperSupersetOf<T>(INotifyEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>)

Gets a value indicating whether the given collection is a proper superset of the current collection

[ObservableProxy(typeof(ObservableProperSupersetOf<>), "CreateWithComparer", false)]
public static bool IsProperSupersetOf<T>(this INotifyEnumerable<T> source, IEnumerable<T> other, IEqualityComparer<T> comparer)

Parameters

source INotifyEnumerable<T>

The source collection

other IEnumerable<T>

The collection that is compared to

comparer IEqualityComparer<T>

The comparer to define equality

Returns

bool

True, if all elements of the given collection are contained in the current collection but not inverse, otherwise False

Type Parameters

T

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

IsSubsetOf<T>(INotifyEnumerable<T>, IEnumerable<T>)

Gets a value indicating whether the given collection is a proper subset of the current collection

[ObservableProxy(typeof(ObservableSubsetOf<>), "Create", false)]
public static bool IsSubsetOf<T>(this INotifyEnumerable<T> source, IEnumerable<T> other)

Parameters

source INotifyEnumerable<T>

The source collection

other IEnumerable<T>

The collection that is compared to

Returns

bool

True, if all elements of the current collection are contained in the given collection, otherwise False

Type Parameters

T

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

IsSubsetOf<T>(INotifyEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>)

Gets a value indicating whether the given collection is a proper subset of the current collection

[ObservableProxy(typeof(ObservableSubsetOf<>), "CreateWithComparer", false)]
public static bool IsSubsetOf<T>(this INotifyEnumerable<T> source, IEnumerable<T> other, IEqualityComparer<T> comparer)

Parameters

source INotifyEnumerable<T>

The source collection

other IEnumerable<T>

The collection that is compared to

comparer IEqualityComparer<T>

The comparer to define equality

Returns

bool

True, if all elements of the current collection are contained in the given collection, otherwise False

Type Parameters

T

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

IsSupersetOf<T>(INotifyEnumerable<T>, IEnumerable<T>)

Gets a value indicating whether the given collection is a proper superset of the current collection

[ObservableProxy(typeof(ObservableSupersetOf<>), "Create", false)]
public static bool IsSupersetOf<T>(this INotifyEnumerable<T> source, IEnumerable<T> other)

Parameters

source INotifyEnumerable<T>

The source collection

other IEnumerable<T>

The collection that is compared to

Returns

bool

True, if all elements of the given collection are contained in the current collection, otherwise False

Type Parameters

T

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

IsSupersetOf<T>(INotifyEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>)

Gets a value indicating whether the given collection is a proper superset of the current collection

[ObservableProxy(typeof(ObservableSupersetOf<>), "CreateWithComparer", false)]
public static bool IsSupersetOf<T>(this INotifyEnumerable<T> source, IEnumerable<T> other, IEqualityComparer<T> comparer)

Parameters

source INotifyEnumerable<T>

The source collection

other IEnumerable<T>

The collection that is compared to

comparer IEqualityComparer<T>

The comparer to define equality

Returns

bool

True, if all elements of the given collection are contained in the current collection, otherwise False

Type Parameters

T

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Join<TOuter, TInner, TKey, TResult>(INotifyEnumerable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, TInner, TResult>>)

Joins the current collection with the given other collection

public static INotifyEnumerable<TResult> Join<TOuter, TInner, TKey, TResult>(this INotifyEnumerable<TOuter> outerSource, IEnumerable<TInner> innerSource, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner, TResult>> resultSelector)

Parameters

outerSource INotifyEnumerable<TOuter>

The current collection

innerSource IEnumerable<TInner>

The other collection to join with

outerKeySelector Expression<Func<TOuter, TKey>>

A lambda expression to select the key for the current collections items

innerKeySelector Expression<Func<TInner, TKey>>

A lambda expression to select the key for the given other collections items

resultSelector Expression<Func<TOuter, TInner, TResult>>

A lambda expression to select the result for a given pair of elements

Returns

INotifyEnumerable<TResult>

A joined collection

Type Parameters

TOuter

The element type of the current collection

TInner

The element type of the other collection

TKey

The type of the keys for which the collections should be joined

TResult

The join result type

Join<TOuter, TInner, TKey, TResult>(INotifyEnumerable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, TInner, TResult>>, IEqualityComparer<TKey>)

Joins the current collection with the given other collection

public static INotifyEnumerable<TResult> Join<TOuter, TInner, TKey, TResult>(this INotifyEnumerable<TOuter> outerSource, IEnumerable<TInner> innerSource, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner, TResult>> resultSelector, IEqualityComparer<TKey> comparer)

Parameters

outerSource INotifyEnumerable<TOuter>

The current collection

innerSource IEnumerable<TInner>

The other collection to join with

outerKeySelector Expression<Func<TOuter, TKey>>

A lambda expression to select the key for the current collections items

innerKeySelector Expression<Func<TInner, TKey>>

A lambda expression to select the key for the given other collections items

resultSelector Expression<Func<TOuter, TInner, TResult>>

A lambda expression to select the result for a given pair of elements

comparer IEqualityComparer<TKey>

An equality comparer to define when two keys are equivalent

Returns

INotifyEnumerable<TResult>

A joined collection

Type Parameters

TOuter

The element type of the current collection

TInner

The element type of the other collection

TKey

The type of the keys for which the collections should be joined

TResult

The join result type

Max<TSource>(INotifyEnumerable<TSource?>)

Gets the maximum element of the given collection

[ObservableProxy(typeof(ObservableComparisons), "NullableMax", false)]
public static TSource? Max<TSource>(this INotifyEnumerable<TSource?> source) where TSource : struct, IComparable<TSource>

Parameters

source INotifyEnumerable<TSource?>

The collection

Returns

TSource?

An element which is maximal

Type Parameters

TSource

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Max<TSource>(INotifyEnumerable<TSource?>, IComparer<TSource>)

Gets the maximum element of the given collection

[ObservableProxy(typeof(ObservableComparisons), "NullableMaxWithComparer", false)]
public static TSource? Max<TSource>(this INotifyEnumerable<TSource?> source, IComparer<TSource> comparer) where TSource : struct

Parameters

source INotifyEnumerable<TSource?>

The collection

comparer IComparer<TSource>

A comparer for custom comparison

Returns

TSource?

An element which is maximal

Type Parameters

TSource

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Max<TSource>(INotifyEnumerable<TSource>)

Gets the maximum element of the given collection

[ObservableProxy(typeof(ObservableComparisons), "Max", false)]
public static TSource Max<TSource>(this INotifyEnumerable<TSource> source) where TSource : IComparable<TSource>

Parameters

source INotifyEnumerable<TSource>

The collection

Returns

TSource

An element which is maximal

Type Parameters

TSource

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Max<TSource>(INotifyEnumerable<TSource>, IComparer<TSource>)

Gets the maximum element of the given collection

[ObservableProxy(typeof(ObservableComparisons), "MaxWithComparer", false)]
public static TSource Max<TSource>(this INotifyEnumerable<TSource> source, IComparer<TSource> comparer)

Parameters

source INotifyEnumerable<TSource>

The collection

comparer IComparer<TSource>

A comparer for custom comparison

Returns

TSource

An element which is maximal

Type Parameters

TSource

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Max<TSource, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, TResult?>>)

Gets the maximum feature of the given collection

[ObservableProxy(typeof(ObservableComparisons), "LambdaNullableMax", false)]
public static TResult? Max<TSource, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TResult?>> selector) where TResult : struct, IComparable<TResult>

Parameters

source INotifyEnumerable<TSource>

The collection

selector Expression<Func<TSource, TResult?>>

A lambda expression to obtain the elements feature in quest

Returns

TResult?

An elements feature which is maximal

Type Parameters

TSource

The element type

TResult

The result type of the comparison

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Max<TSource, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, TResult?>>, IComparer<TResult>)

Gets the maximum feature of the given collection

[ObservableProxy(typeof(ObservableComparisons), "LambdaNullableMaxWithComparer", false)]
public static TResult? Max<TSource, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TResult?>> selector, IComparer<TResult> comparer) where TResult : struct

Parameters

source INotifyEnumerable<TSource>

The collection

selector Expression<Func<TSource, TResult?>>

A lambda expression to obtain the elements feature in quest

comparer IComparer<TResult>

A comparer for custom comparison

Returns

TResult?

An elements feature which is maximal

Type Parameters

TSource

The element type

TResult

The result type of the comparison

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Max<TSource, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, TResult>>)

Gets the maximum feature of the given collection

[ObservableProxy(typeof(ObservableComparisons), "LambdaMax", false)]
public static TResult Max<TSource, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TResult>> selector) where TResult : IComparable<TResult>

Parameters

source INotifyEnumerable<TSource>

The collection

selector Expression<Func<TSource, TResult>>

A lambda expression to obtain the elements feature in quest

Returns

TResult

An elements feature which is maximal

Type Parameters

TSource

The element type

TResult

The result type of the comparison

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Max<TSource, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, TResult>>, IComparer<TResult>)

Gets the maximum feature of the given collection

[ObservableProxy(typeof(ObservableComparisons), "LambdaMaxWithComparer", false)]
public static TResult Max<TSource, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TResult>> selector, IComparer<TResult> comparer)

Parameters

source INotifyEnumerable<TSource>

The collection

selector Expression<Func<TSource, TResult>>

A lambda expression to obtain the elements feature in quest

comparer IComparer<TResult>

A comparer for custom comparison

Returns

TResult

An elements feature which is maximal

Type Parameters

TSource

The element type

TResult

The result type of the comparison

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Min<TSource>(INotifyEnumerable<TSource?>)

Gets the minimum element of the given collection

[ObservableProxy(typeof(ObservableComparisons), "NullableMin", false)]
public static TSource? Min<TSource>(this INotifyEnumerable<TSource?> source) where TSource : struct, IComparable<TSource>

Parameters

source INotifyEnumerable<TSource?>

The collection

Returns

TSource?

An element which is minimal

Type Parameters

TSource

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Min<TSource>(INotifyEnumerable<TSource?>, IComparer<TSource>)

Gets the minimum element of the given collection

[ObservableProxy(typeof(ObservableComparisons), "NullableMinWithComparer", false)]
public static TSource? Min<TSource>(this INotifyEnumerable<TSource?> source, IComparer<TSource> comparer) where TSource : struct

Parameters

source INotifyEnumerable<TSource?>

The collection

comparer IComparer<TSource>

A comparer for custom comparison

Returns

TSource?

An element which is minimal

Type Parameters

TSource

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Min<TSource>(INotifyEnumerable<TSource>)

Gets the minimum element of the given collection

[ObservableProxy(typeof(ObservableComparisons), "Min", false)]
public static TSource Min<TSource>(this INotifyEnumerable<TSource> source) where TSource : IComparable<TSource>

Parameters

source INotifyEnumerable<TSource>

The collection

Returns

TSource

An element which is minimal

Type Parameters

TSource

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Min<TSource>(INotifyEnumerable<TSource>, IComparer<TSource>)

Gets the minimum element of the given collection

[ObservableProxy(typeof(ObservableComparisons), "MinWithComparer", false)]
public static TSource Min<TSource>(this INotifyEnumerable<TSource> source, IComparer<TSource> comparer)

Parameters

source INotifyEnumerable<TSource>

The collection

comparer IComparer<TSource>

A comparer for custom comparison

Returns

TSource

An element which is minimal

Type Parameters

TSource

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Min<TSource, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, TResult?>>)

Gets the minimum feature of the given collection

[ObservableProxy(typeof(ObservableComparisons), "LambdaNullableMin", false)]
public static TResult? Min<TSource, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TResult?>> selector) where TResult : struct, IComparable<TResult>

Parameters

source INotifyEnumerable<TSource>

The collection

selector Expression<Func<TSource, TResult?>>

A lambda expression to obtain the elements feature in quest

Returns

TResult?

An elements feature which is minimal

Type Parameters

TSource

The element type

TResult

The result type of the comparison

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Min<TSource, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, TResult?>>, IComparer<TResult>)

Gets the minimum feature of the given collection

[ObservableProxy(typeof(ObservableComparisons), "LambdaNullableMinWithComparer", false)]
public static TResult? Min<TSource, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TResult?>> selector, IComparer<TResult> comparer) where TResult : struct

Parameters

source INotifyEnumerable<TSource>

The collection

selector Expression<Func<TSource, TResult?>>

A lambda expression to obtain the elements feature in quest

comparer IComparer<TResult>

A comparer for custom comparison

Returns

TResult?

An elements feature which is minimal

Type Parameters

TSource

The element type

TResult

The result type of the comparison

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Min<TSource, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, TResult>>)

Gets the minimum feature of the given collection

[ObservableProxy(typeof(ObservableComparisons), "LambdaMin", false)]
public static TResult Min<TSource, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TResult>> selector) where TResult : IComparable<TResult>

Parameters

source INotifyEnumerable<TSource>

The collection

selector Expression<Func<TSource, TResult>>

A lambda expression to obtain the elements feature in quest

Returns

TResult

An elements feature which is minimal

Type Parameters

TSource

The element type

TResult

The result type of the comparison

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Min<TSource, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, TResult>>, IComparer<TResult>)

Gets the minimum feature of the given collection

[ObservableProxy(typeof(ObservableComparisons), "LambdaMinWithComparer", false)]
public static TResult Min<TSource, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TResult>> selector, IComparer<TResult> comparer)

Parameters

source INotifyEnumerable<TSource>

The collection

selector Expression<Func<TSource, TResult>>

A lambda expression to obtain the elements feature in quest

comparer IComparer<TResult>

A comparer for custom comparison

Returns

TResult

An elements feature which is minimal

Type Parameters

TSource

The element type

TResult

The result type of the comparison

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

OfType<TResult>(INotifyEnumerable)

Filters the given collection for elements of the given type

public static INotifyEnumerable<TResult> OfType<TResult>(this INotifyEnumerable source)

Parameters

source INotifyEnumerable

The current collection

Returns

INotifyEnumerable<TResult>

A collection containing the elements of the given type

Type Parameters

TResult

The result type

OfType<TSource, TResult>(INotifyCollection<TSource>)

Filters the given collection for elements of the given type

public static INotifyCollection<TResult> OfType<TSource, TResult>(this INotifyCollection<TSource> source) where TResult : TSource

Parameters

source INotifyCollection<TSource>

The current collection

Returns

INotifyCollection<TResult>

A collection containing the elements of the given type

Type Parameters

TSource

The type of the original collection

TResult

The result type

OrderByDescending<TItem, TKey>(INotifyEnumerable<TItem>, Expression<Func<TItem, TKey>>)

Orders the given collection descending by the given predicate

public static IOrderableNotifyEnumerable<TItem> OrderByDescending<TItem, TKey>(this INotifyEnumerable<TItem> source, Expression<Func<TItem, TKey>> keySelector)

Parameters

source INotifyEnumerable<TItem>

The collection that should be sorted

keySelector Expression<Func<TItem, TKey>>

A lambda expression selecting the sorting keys for the given collection

Returns

IOrderableNotifyEnumerable<TItem>

A collection with the elements contained in the current collection sorted by the given predicate

Type Parameters

TItem

The elements type

TKey

The type of the keys used for ordering

OrderByDescending<TItem, TKey>(INotifyEnumerable<TItem>, Expression<Func<TItem, TKey>>, IComparer<TKey>)

Orders the given collection descending by the given predicate

public static IOrderableNotifyEnumerable<TItem> OrderByDescending<TItem, TKey>(this INotifyEnumerable<TItem> source, Expression<Func<TItem, TKey>> keySelector, IComparer<TKey> comparer)

Parameters

source INotifyEnumerable<TItem>

The collection that should be sorted

keySelector Expression<Func<TItem, TKey>>

A lambda expression selecting the sorting keys for the given collection

comparer IComparer<TKey>

A comparer for custom comparison

Returns

IOrderableNotifyEnumerable<TItem>

A collection with the elements contained in the current collection sorted by the given predicate

Type Parameters

TItem

The elements type

TKey

The type of the keys used for ordering

OrderBy<TItem, TKey>(INotifyEnumerable<TItem>, Expression<Func<TItem, TKey>>)

Orders the given collection ascending by the given predicate

public static IOrderableNotifyEnumerable<TItem> OrderBy<TItem, TKey>(this INotifyEnumerable<TItem> source, Expression<Func<TItem, TKey>> keySelector)

Parameters

source INotifyEnumerable<TItem>

The collection that should be sorted

keySelector Expression<Func<TItem, TKey>>

A lambda expression selecting the sorting keys for the given collection

Returns

IOrderableNotifyEnumerable<TItem>

A collection with the elements contained in the current collection sorted by the given predicate

Type Parameters

TItem

The elements type

TKey

The type of the keys used for ordering

OrderBy<TItem, TKey>(INotifyEnumerable<TItem>, Expression<Func<TItem, TKey>>, IComparer<TKey>)

Orders the given collection ascending by the given predicate

public static IOrderableNotifyEnumerable<TItem> OrderBy<TItem, TKey>(this INotifyEnumerable<TItem> source, Expression<Func<TItem, TKey>> keySelector, IComparer<TKey> comparer)

Parameters

source INotifyEnumerable<TItem>

The collection that should be sorted

keySelector Expression<Func<TItem, TKey>>

A lambda expression selecting the sorting keys for the given collection

comparer IComparer<TKey>

A comparer for custom comparison

Returns

IOrderableNotifyEnumerable<TItem>

A collection with the elements contained in the current collection sorted by the given predicate

Type Parameters

TItem

The elements type

TKey

The type of the keys used for ordering

RestoreIndices<T>(INotifyEnumerable<T>)

Restores the indices of the given collection

public static IEnumerable<T> RestoreIndices<T>(this INotifyEnumerable<T> source)

Parameters

source INotifyEnumerable<T>

the source incremental collection

Returns

IEnumerable<T>

A collection that mirrors the given incremental collection but restores change indices

Type Parameters

T

The type of elements

Remarks

Some frameworks (like Avalonia) require that indices of elements are always set

SelectMany<TSource, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, IEnumerable<TResult>>>)

Flattens the given collection of collections where the subsequent collections are selected by a predicate

public static INotifyEnumerable<TResult> SelectMany<TSource, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, IEnumerable<TResult>>> selector)

Parameters

source INotifyEnumerable<TSource>

The current collection

selector Expression<Func<TSource, IEnumerable<TResult>>>

A lambda expression to select subsequent collections

Returns

INotifyEnumerable<TResult>

A collection with the results

Type Parameters

TSource

The source element type

TResult

The result element type

SelectMany<TSource, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, IEnumerable<TResult>>>, Func<TSource, IEnumerable<TResult>>)

Flattens the given collection of collections where the subsequent collections are selected by a predicate

public static INotifyEnumerable<TResult> SelectMany<TSource, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, IEnumerable<TResult>>> selector, Func<TSource, IEnumerable<TResult>> selectorCompiled)

Parameters

source INotifyEnumerable<TSource>

The current collection

selector Expression<Func<TSource, IEnumerable<TResult>>>

A lambda expression to select subsequent collections

selectorCompiled Func<TSource, IEnumerable<TResult>>

A compiled version of the selector

Returns

INotifyEnumerable<TResult>

A collection with the results

Type Parameters

TSource

The source element type

TResult

The result element type

SelectMany<TSource, TIntermediate, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, IEnumerable<TIntermediate>>>, Func<TSource, IEnumerable<TIntermediate>>, Expression<Func<TSource, TIntermediate, TResult>>, Func<TSource, TIntermediate, TResult>)

Flattens the given collection of collections where the subsequent collections are selected by a predicate

public static INotifyEnumerable<TResult> SelectMany<TSource, TIntermediate, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, IEnumerable<TIntermediate>>> func, Func<TSource, IEnumerable<TIntermediate>> funcCompiled, Expression<Func<TSource, TIntermediate, TResult>> selector, Func<TSource, TIntermediate, TResult> selectorCompiled)

Parameters

source INotifyEnumerable<TSource>

The current collection

func Expression<Func<TSource, IEnumerable<TIntermediate>>>

A lambda expression to select subsequent collections

funcCompiled Func<TSource, IEnumerable<TIntermediate>>

A compiled version of func

selector Expression<Func<TSource, TIntermediate, TResult>>

A lambda expression that determines the result element given the element of the source collection and the element of the subsequent collection

selectorCompiled Func<TSource, TIntermediate, TResult>

A compiled version of selector

Returns

INotifyEnumerable<TResult>

A collection with the results

Type Parameters

TSource

The source element type

TIntermediate

The element type of the subsequent collection

TResult

The result element type

SelectMany<TSource, TIntermediate, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, IEnumerable<TIntermediate>>>, Expression<Func<TSource, TIntermediate, TResult>>)

Flattens the given collection of collections where the subsequent collections are selected by a predicate

public static INotifyEnumerable<TResult> SelectMany<TSource, TIntermediate, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, IEnumerable<TIntermediate>>> func, Expression<Func<TSource, TIntermediate, TResult>> selector)

Parameters

source INotifyEnumerable<TSource>

The current collection

func Expression<Func<TSource, IEnumerable<TIntermediate>>>

A lambda expression to select subsequent collections

selector Expression<Func<TSource, TIntermediate, TResult>>

A lambda expression that determines the result element given the element of the source collection and the element of the subsequent collection

Returns

INotifyEnumerable<TResult>

A collection with the results

Type Parameters

TSource

The source element type

TIntermediate

The element type of the subsequent collection

TResult

The result element type

Select<TSource, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, TResult>>)

Maps the current collection to the given lambda expression

public static INotifyEnumerable<TResult> Select<TSource, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TResult>> selector)

Parameters

source INotifyEnumerable<TSource>

The current collection

selector Expression<Func<TSource, TResult>>

A lambda expression representing the mapping result for a given item

Returns

INotifyEnumerable<TResult>

A collection with the mapping results

Type Parameters

TSource

The elements type

TResult

The result element type

Select<TSource, TResult>(INotifyEnumerable<TSource>, Expression<Func<TSource, TResult>>, Func<TSource, TResult>)

Maps the current collection to the given lambda expression

public static INotifyEnumerable<TResult> Select<TSource, TResult>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, TResult>> selector, Func<TSource, TResult> selectorCompiled)

Parameters

source INotifyEnumerable<TSource>

The current collection

selector Expression<Func<TSource, TResult>>

A lambda expression representing the mapping result for a given item

selectorCompiled Func<TSource, TResult>

A compiled form of the selector

Returns

INotifyEnumerable<TResult>

A collection with the mapping results

Type Parameters

TSource

The elements type

TResult

The result element type

SetEquals<T>(INotifyEnumerable<T>, IEnumerable<T>)

Gets a value indicating whether the current collection and the given collection contain the same set of elements, regardless of their order

[ObservableProxy(typeof(ObservableSetEquals<>), "Create", false)]
public static bool SetEquals<T>(this INotifyEnumerable<T> source, IEnumerable<T> other)

Parameters

source INotifyEnumerable<T>

The current collection

other IEnumerable<T>

The given other collection

Returns

bool

True, if both collections contain the same set of elements, otherwise False

Type Parameters

T

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

SetEquals<T>(INotifyEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>)

Gets a value indicating whether the current collection and the given collection contain the same set of elements, regardless of their order

[ObservableProxy(typeof(ObservableSetEquals<>), "CreateWithComparer", false)]
public static bool SetEquals<T>(this INotifyEnumerable<T> source, IEnumerable<T> other, IEqualityComparer<T> comparer)

Parameters

source INotifyEnumerable<T>

The current collection

other IEnumerable<T>

The given other collection

comparer IEqualityComparer<T>

An equality comparer used to determine equality in the sets

Returns

bool

True, if both collections contain the same set of elements, otherwise False

Type Parameters

T

The element type

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

SingleOrDefault<TSource>(INotifyEnumerable<TSource>)

Gets the single item of the given source collection or the item type default value, if the collection is empty

[ObservableProxy(typeof(ObservableSingleOrDefault<>), "Create", false)]
[SetExpressionRewriter(typeof(ObservableSingleOrDefault<>), "CreateSetExpression")]
public static TSource SingleOrDefault<TSource>(this INotifyEnumerable<TSource> source)

Parameters

source INotifyEnumerable<TSource>

The source collection

Returns

TSource

The single item of the collection or the type default value, if the collection is empty

Type Parameters

TSource

The element type of the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

SingleOrDefault<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, bool>>)

Gets the first item of the given source collection that matches the given predicate or the item type default value, if the collection is empty or no item matches the given predicate

[ObservableProxy(typeof(ObservableSingleOrDefault<>), "CreateForPredicate", false)]
[SetExpressionRewriter(typeof(ObservableSingleOrDefault<>), "CreateSetExpressionWithPredicate")]
public static TSource SingleOrDefault<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, bool>> predicate)

Parameters

source INotifyEnumerable<TSource>

The source collection

predicate Expression<Func<TSource, bool>>

The filter predicate

Returns

TSource

The first item of the collection that matches the predicate or the type default value

Type Parameters

TSource

The element type of the source collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum(INotifyEnumerable<decimal>)

Gets the sum of the current collection

[ObservableProxy(typeof(ObservableSum), "SumDecimal", false)]
public static decimal Sum(this INotifyEnumerable<decimal> source)

Parameters

source INotifyEnumerable<decimal>

The collection of numbers

Returns

decimal

The sum of the numbers contained in this collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum(INotifyEnumerable<double>)

Gets the sum of the current collection

[ObservableProxy(typeof(ObservableSum), "SumDouble", false)]
public static double Sum(this INotifyEnumerable<double> source)

Parameters

source INotifyEnumerable<double>

The collection of numbers

Returns

double

The sum of the numbers contained in this collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum(INotifyEnumerable<int>)

Gets the sum of the current collection

[ObservableProxy(typeof(ObservableSum), "SumInt", false)]
public static int Sum(this INotifyEnumerable<int> source)

Parameters

source INotifyEnumerable<int>

The collection of numbers

Returns

int

The sum of the numbers contained in this collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum(INotifyEnumerable<long>)

Gets the sum of the current collection

[ObservableProxy(typeof(ObservableSum), "SumLong", false)]
public static long Sum(this INotifyEnumerable<long> source)

Parameters

source INotifyEnumerable<long>

The collection of numbers

Returns

long

The sum of the numbers contained in this collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum(INotifyEnumerable<decimal?>)

Gets the sum of the current collection

[ObservableProxy(typeof(ObservableSum), "SumNullableDecimal", false)]
public static decimal? Sum(this INotifyEnumerable<decimal?> source)

Parameters

source INotifyEnumerable<decimal?>

The collection of numbers

Returns

decimal?

The sum of the numbers contained in this collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum(INotifyEnumerable<double?>)

Gets the sum of the current collection

[ObservableProxy(typeof(ObservableSum), "SumNullableDouble", false)]
public static double? Sum(this INotifyEnumerable<double?> source)

Parameters

source INotifyEnumerable<double?>

The collection of numbers

Returns

double?

The sum of the numbers contained in this collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum(INotifyEnumerable<int?>)

Gets the sum of the current collection

[ObservableProxy(typeof(ObservableSum), "SumNullableInt", false)]
public static int? Sum(this INotifyEnumerable<int?> source)

Parameters

source INotifyEnumerable<int?>

The collection of numbers

Returns

int?

The sum of the numbers contained in this collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum(INotifyEnumerable<long?>)

Gets the sum of the current collection

[ObservableProxy(typeof(ObservableSum), "SumNullableLong", false)]
public static long? Sum(this INotifyEnumerable<long?> source)

Parameters

source INotifyEnumerable<long?>

The collection of numbers

Returns

long?

The sum of the numbers contained in this collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum(INotifyEnumerable<float?>)

Gets the sum of the current collection

[ObservableProxy(typeof(ObservableSum), "SumNullableFloat", false)]
public static float? Sum(this INotifyEnumerable<float?> source)

Parameters

source INotifyEnumerable<float?>

The collection of numbers

Returns

float?

The sum of the numbers contained in this collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum(INotifyEnumerable<float>)

Gets the sum of the current collection

[ObservableProxy(typeof(ObservableSum), "SumFloat", false)]
public static float Sum(this INotifyEnumerable<float> source)

Parameters

source INotifyEnumerable<float>

The collection of numbers

Returns

float

The sum of the numbers contained in this collection

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, decimal>>)

Gets the sum of the current collections features

[ObservableProxy(typeof(ObservableSum), "SumLambdaDecimal", false)]
public static decimal Sum<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, decimal>> selector)

Parameters

source INotifyEnumerable<TSource>

The collection of numbers

selector Expression<Func<TSource, decimal>>

A lambda expression to represent the feature to be summed up

Returns

decimal

The sum of the numbers contained in this collection elements features

Type Parameters

TSource

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, double>>)

Gets the sum of the current collections features

[ObservableProxy(typeof(ObservableSum), "SumLambdaDouble", false)]
public static double Sum<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, double>> selector)

Parameters

source INotifyEnumerable<TSource>

The collection of numbers

selector Expression<Func<TSource, double>>

A lambda expression to represent the feature to be summed up

Returns

double

The sum of the numbers contained in this collection elements features

Type Parameters

TSource

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, int>>)

Gets the sum of the current collections features

[ObservableProxy(typeof(ObservableSum), "SumLambdaInt", false)]
public static int Sum<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, int>> selector)

Parameters

source INotifyEnumerable<TSource>

The collection of numbers

selector Expression<Func<TSource, int>>

A lambda expression to represent the feature to be summed up

Returns

int

The sum of the numbers contained in this collection elements features

Type Parameters

TSource

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, long>>)

Gets the sum of the current collections features

[ObservableProxy(typeof(ObservableSum), "SumLambdaLong", false)]
public static long Sum<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, long>> selector)

Parameters

source INotifyEnumerable<TSource>

The collection of numbers

selector Expression<Func<TSource, long>>

A lambda expression to represent the feature to be summed up

Returns

long

The sum of the numbers contained in this collection elements features

Type Parameters

TSource

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, decimal?>>)

Gets the sum of the current collections features

[ObservableProxy(typeof(ObservableSum), "SumLambdaNullableDecimal", false)]
public static decimal? Sum<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, decimal?>> selector)

Parameters

source INotifyEnumerable<TSource>

The collection of numbers

selector Expression<Func<TSource, decimal?>>

A lambda expression to represent the feature to be summed up

Returns

decimal?

The sum of the numbers contained in this collection elements features

Type Parameters

TSource

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, double?>>)

Gets the sum of the current collections features

[ObservableProxy(typeof(ObservableSum), "SumLambdaNullableDouble", false)]
public static double? Sum<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, double?>> selector)

Parameters

source INotifyEnumerable<TSource>

The collection of numbers

selector Expression<Func<TSource, double?>>

A lambda expression to represent the feature to be summed up

Returns

double?

The sum of the numbers contained in this collection elements features

Type Parameters

TSource

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, int?>>)

Gets the sum of the current collections features

[ObservableProxy(typeof(ObservableSum), "SumLambdaNullableInt", false)]
public static int? Sum<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, int?>> selector)

Parameters

source INotifyEnumerable<TSource>

The collection of numbers

selector Expression<Func<TSource, int?>>

A lambda expression to represent the feature to be summed up

Returns

int?

The sum of the numbers contained in this collection elements features

Type Parameters

TSource

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, long?>>)

Gets the sum of the current collections features

[ObservableProxy(typeof(ObservableSum), "SumLambdaNullableLong", false)]
public static long? Sum<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, long?>> selector)

Parameters

source INotifyEnumerable<TSource>

The collection of numbers

selector Expression<Func<TSource, long?>>

A lambda expression to represent the feature to be summed up

Returns

long?

The sum of the numbers contained in this collection elements features

Type Parameters

TSource

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, float?>>)

Gets the sum of the current collections features

[ObservableProxy(typeof(ObservableSum), "SumLambdaNullableFloat", false)]
public static float? Sum<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, float?>> selector)

Parameters

source INotifyEnumerable<TSource>

The collection of numbers

selector Expression<Func<TSource, float?>>

A lambda expression to represent the feature to be summed up

Returns

float?

The sum of the numbers contained in this collection elements features

Type Parameters

TSource

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

Sum<TSource>(INotifyEnumerable<TSource>, Expression<Func<TSource, float>>)

Gets the sum of the current collections features

[ObservableProxy(typeof(ObservableSum), "SumLambdaFloat", false)]
public static float Sum<TSource>(this INotifyEnumerable<TSource> source, Expression<Func<TSource, float>> selector)

Parameters

source INotifyEnumerable<TSource>

The collection of numbers

selector Expression<Func<TSource, float>>

A lambda expression to represent the feature to be summed up

Returns

float

The sum of the numbers contained in this collection elements features

Type Parameters

TSource

Remarks

This method has an observable proxy, i.e. it can be used in a observable expression

ThenByDescending<TItem, TKey>(IOrderableNotifyEnumerable<TItem>, Expression<Func<TItem, TKey>>)

Orders the given orderable collection by the given predicate descending

public static IOrderableNotifyEnumerable<TItem> ThenByDescending<TItem, TKey>(this IOrderableNotifyEnumerable<TItem> source, Expression<Func<TItem, TKey>> keySelector)

Parameters

source IOrderableNotifyEnumerable<TItem>

The current collection

keySelector Expression<Func<TItem, TKey>>

A lambda expression to select the features used for ordering

Returns

IOrderableNotifyEnumerable<TItem>

A collection with the elements of the current collection but ordered in lower priority for the given predicate

Type Parameters

TItem

The elements type

TKey

The ordering key type

ThenByDescending<TItem, TKey>(IOrderableNotifyEnumerable<TItem>, Expression<Func<TItem, TKey>>, IComparer<TKey>)

Orders the given orderable collection by the given predicate descending

public static IOrderableNotifyEnumerable<TItem> ThenByDescending<TItem, TKey>(this IOrderableNotifyEnumerable<TItem> source, Expression<Func<TItem, TKey>> keySelector, IComparer<TKey> comparer)

Parameters

source IOrderableNotifyEnumerable<TItem>

The current collection

keySelector Expression<Func<TItem, TKey>>

A lambda expression to select the features used for ordering

comparer IComparer<TKey>

A comparer to determine comparison

Returns

IOrderableNotifyEnumerable<TItem>

A collection with the elements of the current collection but ordered in lower priority for the given predicate

Type Parameters

TItem

The elements type

TKey

The ordering key type

ThenBy<TItem, TKey>(IOrderableNotifyEnumerable<TItem>, Expression<Func<TItem, TKey>>)

Orders the given orderable collection by the given predicate ascending

public static IOrderableNotifyEnumerable<TItem> ThenBy<TItem, TKey>(this IOrderableNotifyEnumerable<TItem> source, Expression<Func<TItem, TKey>> keySelector)

Parameters

source IOrderableNotifyEnumerable<TItem>

The current collection

keySelector Expression<Func<TItem, TKey>>

A lambda expression to select the features used for ordering

Returns

IOrderableNotifyEnumerable<TItem>

A collection with the elements of the current collection but ordered in lower priority for the given predicate

Type Parameters

TItem

The elements type

TKey

The ordering key type

ThenBy<TItem, TKey>(IOrderableNotifyEnumerable<TItem>, Expression<Func<TItem, TKey>>, IComparer<TKey>)

Orders the given orderable collection by the given predicate ascending

public static IOrderableNotifyEnumerable<TItem> ThenBy<TItem, TKey>(this IOrderableNotifyEnumerable<TItem> source, Expression<Func<TItem, TKey>> keySelector, IComparer<TKey> comparer)

Parameters

source IOrderableNotifyEnumerable<TItem>

The current collection

keySelector Expression<Func<TItem, TKey>>

A lambda expression to select the features used for ordering

comparer IComparer<TKey>

A comparer to determine comparison

Returns

IOrderableNotifyEnumerable<TItem>

A collection with the elements of the current collection but ordered in lower priority for the given predicate

Type Parameters

TItem

The elements type

TKey

The ordering key type

TopX<TItem, TKey>(INotifyEnumerable<TItem>, int, Expression<Func<TItem, TKey>>)

Gets the top x elements of the given collection, ordered by the given feature

[ObservableProxy(typeof(ObservableTopX<,>), "CreateSelector", false)]
public static KeyValuePair<TItem, TKey>[] TopX<TItem, TKey>(this INotifyEnumerable<TItem> source, int x, Expression<Func<TItem, TKey>> keySelector)

Parameters

source INotifyEnumerable<TItem>

The element source

x int

A number indicating how many items should be selected

keySelector Expression<Func<TItem, TKey>>

An expression to denote the selection of key features

Returns

KeyValuePair<TItem, TKey>[]

An array with the largest entries of the underlying collection

Type Parameters

TItem

The item type

TKey

The key type

TopX<TItem, TKey>(INotifyEnumerable<TItem>, int, Expression<Func<TItem, TKey>>, IComparer<TKey>)

Gets the top x elements of the given collection, ordered by the given feature

[ObservableProxy(typeof(ObservableTopX<,>), "CreateSelectorComparer", false)]
public static KeyValuePair<TItem, TKey>[] TopX<TItem, TKey>(this INotifyEnumerable<TItem> source, int x, Expression<Func<TItem, TKey>> keySelector, IComparer<TKey> comparer)

Parameters

source INotifyEnumerable<TItem>

The element source

x int

A number indicating how many items should be selected

keySelector Expression<Func<TItem, TKey>>

An expression to denote the selection of key features

comparer IComparer<TKey>

A custom comparer

Returns

KeyValuePair<TItem, TKey>[]

An array with the largest entries of the underlying collection

Type Parameters

TItem

The item type

TKey

The key type

Union<TSource>(INotifyEnumerable<TSource>, IEnumerable<TSource>)

Unions the current collection with the given other collection

public static INotifyEnumerable<TSource> Union<TSource>(this INotifyEnumerable<TSource> source, IEnumerable<TSource> source2)

Parameters

source INotifyEnumerable<TSource>

The current collection

source2 IEnumerable<TSource>

The given other collection

Returns

INotifyEnumerable<TSource>

A collection containing the union of both collections

Type Parameters

TSource

The elements type

Union<TSource>(INotifyEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

Unions the current collection with the given other collection

public static INotifyEnumerable<TSource> Union<TSource>(this INotifyEnumerable<TSource> source, IEnumerable<TSource> source2, IEqualityComparer<TSource> comparer)

Parameters

source INotifyEnumerable<TSource>

The current collection

source2 IEnumerable<TSource>

The given other collection

comparer IEqualityComparer<TSource>

A comparer to determine equality

Returns

INotifyEnumerable<TSource>

A collection containing the union of both collections

Type Parameters

TSource

The elements type

Where<T>(INotifyCollection<T>, Expression<Func<T, bool>>)

Filters the given collection with the given predicate

public static INotifyCollection<T> Where<T>(this INotifyCollection<T> source, Expression<Func<T, bool>> filter)

Parameters

source INotifyCollection<T>

The current collection

filter Expression<Func<T, bool>>

The predicate used for filtering

Returns

INotifyCollection<T>

A collection containing the elements that passed the filter

Type Parameters

T

The element type

Where<T>(INotifyCollection<T>, Expression<Func<T, bool>>, Func<T, bool>)

Filters the given collection with the given predicate

public static INotifyCollection<T> Where<T>(this INotifyCollection<T> source, Expression<Func<T, bool>> filter, Func<T, bool> filterCompiled)

Parameters

source INotifyCollection<T>

The current collection

filter Expression<Func<T, bool>>

The predicate used for filtering

filterCompiled Func<T, bool>

A compiled version of filter

Returns

INotifyCollection<T>

A collection containing the elements that passed the filter

Type Parameters

T

The element type

Where<T>(INotifyEnumerable<T>, Expression<Func<T, bool>>)

Filters the given collection with the given predicate

public static INotifyEnumerable<T> Where<T>(this INotifyEnumerable<T> source, Expression<Func<T, bool>> filter)

Parameters

source INotifyEnumerable<T>

The current collection

filter Expression<Func<T, bool>>

The predicate used for filtering

Returns

INotifyEnumerable<T>

A collection containing the elements that passed the filter

Type Parameters

T

The element type

Where<T>(INotifyEnumerable<T>, Expression<Func<T, bool>>, Func<T, bool>)

Filters the given collection with the given predicate

public static INotifyEnumerable<T> Where<T>(this INotifyEnumerable<T> source, Expression<Func<T, bool>> filter, Func<T, bool> filterCompiled)

Parameters

source INotifyEnumerable<T>

The current collection

filter Expression<Func<T, bool>>

The predicate used for filtering

filterCompiled Func<T, bool>

A compiled version of filter

Returns

INotifyEnumerable<T>

A collection containing the elements that passed the filter

Type Parameters

T

The element type

WithUpdates<T>(ICollection<T>)

Fetches updates of the given collection

public static INotifyCollection<T> WithUpdates<T>(this ICollection<T> source)

Parameters

source ICollection<T>

The current collection

Returns

INotifyCollection<T>

The same collection as INotifyEnumerable

Type Parameters

T

The element type

WithUpdates<T>(IEnumerable<T>)

Fetches updates of the given collection

public static INotifyEnumerable<T> WithUpdates<T>(this IEnumerable<T> source)

Parameters

source IEnumerable<T>

The current collection

Returns

INotifyEnumerable<T>

The same collection as INotifyEnumerable

Type Parameters

T

The element type

WithUpdates<T>(IEnumerable<T>, bool)

Fetches updates of the given collection

public static INotifyEnumerable<T> WithUpdates<T>(this IEnumerable<T> source, bool failIfNoOnCollectionChanged)

Parameters

source IEnumerable<T>

The current collection

failIfNoOnCollectionChanged bool

If true, an exception is thrown if no collection changes can be obtained for the given collection, otherwise null is returned in this case.

Returns

INotifyEnumerable<T>

The same collection as INotifyEnumerable

Type Parameters

T

The element type