Table of Contents

Method WithTags

Namespace
Scaleout.Client.QuerySupport
Assembly
Scaleout.Client.dll

WithTags<T>(IQueryable<T>, IEnumerable<string>, IEnumerable<string>)

Adds a filter to the supplied source to allow only values /// of T that have all of the tags specified in tagsSet set while at the same time, none of the tags specified in tagsNotSet are set.

public static IQueryable<T> WithTags<T>(this IQueryable<T> source, IEnumerable<string> tagsSet, IEnumerable<string> tagsNotSet)

Parameters

source IQueryable<T>

The input IQueryable<T>.

tagsSet IEnumerable<string>

The list of tag names that must be present in objects from source to be passed along. You may use the value null to indicate an empty list.

tagsNotSet IEnumerable<string>

The list of tag names that must not be present in objects from source to be passed along. You may use the value null to indicate an empty list.

Returns

IQueryable<T>

An IQueryable<T> extended with the specified filtering.

Type Parameters

T

Examples

from item in ProductsCache.QueryObjects().HasTags(new string[] { "seasonal", "green" }, new string[] { "frozen" }) where item.Weight < 5 select item;

Remarks

Specifying overlapping lists of tags in tagsSet and tagsNotSet always results in an empty enumeration.

Specifying empty lists of tags for both tagsSet and tagsNotSet always returns the original enumeration.