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
sourceIQueryable<T>The input IQueryable<T>.
tagsSetIEnumerable<string>The list of tag names that must be present in objects from
sourceto be passed along. You may use the valuenullto indicate an empty list.tagsNotSetIEnumerable<string>The list of tag names that must not be present in objects from
sourceto be passed along. You may use the valuenullto 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.