DataServiceExtensions.CountDistinct Method

Definition

Overloads

CountDistinct<TSource,TTarget>(IEnumerable<TSource>, Func<TSource,TTarget>)

Returns the distinct count of elements in a sequence after applying the projection function to each element.

CountDistinct<TSource,TTarget>(IQueryable<TSource>, Expression<Func<TSource,TTarget>>)

Returns the distinct count of elements in a sequence after applying the projection function to each element.

CountDistinct<TSource,TTarget>(IEnumerable<TSource>, Func<TSource,TTarget>)

Returns the distinct count of elements in a sequence after applying the projection function to each element.

public static int CountDistinct<TSource,TTarget> (this System.Collections.Generic.IEnumerable<TSource> source, Func<TSource,TTarget> selector);
static member CountDistinct : seq<'Source> * Func<'Source, 'arget> -> int
<Extension()>
Public Function CountDistinct(Of TSource, TTarget) (source As IEnumerable(Of TSource), selector As Func(Of TSource, TTarget)) As Integer

Type Parameters

TSource

The type of the elements of source

TTarget

The type returned by the projection function represented in selector.

Parameters

source
IEnumerable<TSource>

A sequence of values of type TSource.

selector
Func<TSource,TTarget>

A transform function to apply to each element.

Returns

Distinct count of elements in a sequence after applying the projection function to each element.

Applies to

CountDistinct<TSource,TTarget>(IQueryable<TSource>, Expression<Func<TSource,TTarget>>)

Returns the distinct count of elements in a sequence after applying the projection function to each element.

public static int CountDistinct<TSource,TTarget> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,TTarget>> selector);
static member CountDistinct : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, 'arget>> -> int
<Extension()>
Public Function CountDistinct(Of TSource, TTarget) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, TTarget))) As Integer

Type Parameters

TSource

The type of the elements of source

TTarget

The type returned by the projection function represented in selector.

Parameters

source
IQueryable<TSource>

A sequence of values of type TSource.

selector
Expression<Func<TSource,TTarget>>

A projection function to apply to each element.

Returns

Distinct count of elements in a sequence after applying the projection function to each element.

Applies to