The AppFabric DataCache
class allows user-defined tags to be associated with an object using the Add
or Put
methods. Tags allow groups of objects to be selected and removed together instead of accessing them through their individual
keys.
In the ScaleOut NamedCache API, tags are stored on your objects themselves rather than specified separately through API calls.
Classes that need to support tags must implement the ITaggable
interface, after which a set of extension methods (AddTags
and RemoveTags
) can be used to specify which tags are associated with an object.
Once an object is tagged, ScaleOut’s LINQ provider allows you to query for tagged objects—the service supports HasAllTags, HasAnyTag, and HasTags methods in LINQ where clauses.
ScaleOut’s .NET API Reference contains a Support for Tags topic that has helpful code samples and a conceptual overview of how to tag your objects. The Querying Tags topic illustrates how you can query for tagged objects using ScaleOut’s LINQ provider.
ScaleOut StateServer offers indexing and query support that is much richer than simple tags. Marking your class properties
with a SossIndex
attribute allows the service to index objects using values in that property, which makes those objects eligible for selection
using ScaleOut’s LINQ provider.
While full coverage of the LINQ provider is outside of the scope of this document, the .NET API Reference covers indexing and LINQ in great depth starting with its LINQ Overview topic.