CosmosLinqExtensions Class

Definition

This class provides extension methods for cosmos LINQ code.

public static class CosmosLinqExtensions
type CosmosLinqExtensions = class
Public Module CosmosLinqExtensions
Inheritance
CosmosLinqExtensions

Methods

Name Description
ArrayContainsAll<T>(IEnumerable<T>, Object[])

Returns whether all values are present in the array.

ArrayContainsAny<T>(IEnumerable<T>, Object[])

Returns whether any values are present in the array.

AverageAsync(IQueryable<Decimal>, CancellationToken)

Computes the average of a sequence of Decimal values.

AverageAsync(IQueryable<Double>, CancellationToken)

Computes the average of a sequence of Double values.

AverageAsync(IQueryable<Int32>, CancellationToken)

Computes the average of a sequence of Int32 values.

AverageAsync(IQueryable<Int64>, CancellationToken)

Computes the average of a sequence of Int64 values.

AverageAsync(IQueryable<Nullable<Decimal>>, CancellationToken)

Computes the average of a sequence of Nullable<T> values.

AverageAsync(IQueryable<Nullable<Double>>, CancellationToken)

Computes the average of a sequence of Nullable<T> values.

AverageAsync(IQueryable<Nullable<Int32>>, CancellationToken)

Computes the average of a sequence of Nullable<T> values.

AverageAsync(IQueryable<Nullable<Int64>>, CancellationToken)

Computes the average of a sequence of Nullable<T> values.

AverageAsync(IQueryable<Nullable<Single>>, CancellationToken)

Computes the average of a sequence of Nullable<T> values.

AverageAsync(IQueryable<Single>, CancellationToken)

Computes the average of a sequence of Single values.

CountAsync<TSource>(IQueryable<TSource>, CancellationToken)

Returns the number of elements in a sequence.

DocumentId(Object)

Returns the integer identifier corresponding to a specific item within a physical partition. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

FullTextContains(Object, String)

Returns a boolean indicating whether the keyword string expression is contained in a specified property path. For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/fulltextcontains. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

FullTextContainsAll(Object, String[])

Returns a boolean indicating whether all of the provided string expressions are contained in a specified property path. For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/fulltextcontainsall. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

FullTextContainsAny(Object, String[])

Returns a boolean indicating whether any of the provided string expressions are contained in a specified property path. For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/fulltextcontainsany. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

FullTextScore<TSource>(TSource, String[])

Returns a BM25 score value that can only be used in an ORDER BY RANK function to sort results from highest relevancy to lowest relevancy. For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/fulltextscore. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

GetIndexMetrics<T>(Response<T>)

This extension method returns the Index Metrics for a given Response object. The index utilization metrics is to be used for debugging purposes only. This result is only available if QueryRequestOptions.PopulateIndexMetrics is set to true.Returns null if the index metrics is not available in the response.

IsArray(Object)

Returns a Boolean value indicating if the type of the specified expression is an array. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

IsBool(Object)

Returns a Boolean value indicating if the type of the specified expression is a boolean. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

IsDefined(Object)

Determines if a certain property is defined or not. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

IsNull(Object)

Determines if a certain property is null or not. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

IsNumber(Object)

Returns a Boolean value indicating if the type of the specified expression is a number. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

IsObject(Object)

Returns a Boolean value indicating if the type of the specified expression is an object. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

IsPrimitive(Object)

Determines if a certain property is of primitive JSON type. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

IsString(Object)

Returns a Boolean value indicating if the type of the specified expression is a string. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

MaxAsync<TSource>(IQueryable<TSource>, CancellationToken)

Returns the maximum value in a generic IQueryable<T>.

MinAsync<TSource>(IQueryable<TSource>, CancellationToken)

Returns the minimum value in a generic IQueryable<T>.

OrderByRank<TSource,TKey>(IQueryable<TSource>, Expression<Func<TSource,TKey>>)

This optional ORDER BY RANK clause sorts scoring functions by their rank. It's used specifically for scoring functions like VectorDistance, FullTextScore, and RRF. For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/order-by-rank. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

RegexMatch(Object, String, String)

Returns a Boolean value indicating if the specified expression matches the supplied regex pattern. For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/regexmatch. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

RegexMatch(Object, String)

Returns a Boolean value indicating if the specified expression matches the supplied regex pattern. For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/regexmatch. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

RRF(Double[], Double[])

This system function is used to combine two or more scores provided by other scoring functions. For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/rrf. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

RRF(Double[])

This system function is used to combine two or more scores provided by other scoring functions. For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/rrf. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

SumAsync(IQueryable<Decimal>, CancellationToken)

Computes the sum of a sequence of Decimal values.

SumAsync(IQueryable<Double>, CancellationToken)

Computes the sum of a sequence of Double values.

SumAsync(IQueryable<Int32>, CancellationToken)

Computes the sum of a sequence of Int32 values.

SumAsync(IQueryable<Int64>, CancellationToken)

Computes the sum of a sequence of Int64 values.

SumAsync(IQueryable<Nullable<Decimal>>, CancellationToken)

Computes the sum of a sequence of Nullable<T> values.

SumAsync(IQueryable<Nullable<Double>>, CancellationToken)

Computes the sum of a sequence of Nullable<T> values.

SumAsync(IQueryable<Nullable<Int32>>, CancellationToken)

Computes the sum of a sequence of Nullable<T> values.

SumAsync(IQueryable<Nullable<Int64>>, CancellationToken)

Computes the sum of a sequence of Nullable<T> values.

SumAsync(IQueryable<Nullable<Single>>, CancellationToken)

Computes the sum of a sequence of Nullable<T> values.

SumAsync(IQueryable<Single>, CancellationToken)

Computes the sum of a sequence of Single values.

ToFeedIterator<T>(IQueryable<T>)

This extension method gets the FeedIterator from LINQ IQueryable to execute query asynchronously. This will create the fresh new FeedIterator when called.

ToQueryDefinition<T>(IQueryable<T>, IDictionary<Object,String>)

This method generate query definition from LINQ query.

ToQueryDefinition<T>(IQueryable<T>)

This method generate query definition from LINQ query.

ToStreamIterator<T>(IQueryable<T>)

This extension method gets the FeedIterator from LINQ IQueryable to execute query asynchronously. This will create the fresh new FeedIterator when called.

VectorDistance(Byte[], Byte[], Boolean, CosmosLinqExtensions+VectorDistanceOptions)

Returns the similarity score between two specified vectors. For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/vectordistance. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

VectorDistance(SByte[], SByte[], Boolean, CosmosLinqExtensions+VectorDistanceOptions)

Returns the similarity score between two specified vectors. For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/vectordistance. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

VectorDistance(Single[], Single[], Boolean, CosmosLinqExtensions+VectorDistanceOptions)

Returns the similarity score between two specified vectors. For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/vectordistance. This method is to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

Applies to