Presentation is loading. Please wait.

Presentation is loading. Please wait.

Working with Regions and Tags. var dcf = new DataCacheFactory(); //get the cache named "TestCache" var cache = dcf.GetCache("TestCache"); //Add a region.

Similar presentations


Presentation on theme: "Working with Regions and Tags. var dcf = new DataCacheFactory(); //get the cache named "TestCache" var cache = dcf.GetCache("TestCache"); //Add a region."— Presentation transcript:

1 Working with Regions and Tags

2

3 var dcf = new DataCacheFactory(); //get the cache named "TestCache" var cache = dcf.GetCache("TestCache"); //Add a region named "region1" - returns false //if already exists var ret = cache.CreateRegion("region1", false);

4 public DataCacheItemVersion Add(string key, object value, string region); public DataCacheItemVersion Add(string key, object value, TimeSpan timeout, string region); public DataCacheItemVersion Put(string key, object value, string region); public DataCacheItemVersion Put(string key, object value, TimeSpan timeout, string region); Parameterdescription keyKey of item in the distributed cache valueValue of object stored in the cache (serialized) timeoutHow long before the item should expire regionNamed region to place item

5

6 namespace Microsoft.ApplicationServer.Caching { public sealed class DataCacheItem { public DataCacheItem(); public string CacheName { get; internal set; } public string Key { get; } public string RegionName { get; internal set; } public ReadOnlyCollection Tags { get; } public TimeSpan Timeout { get; } public object Value { get; internal set; } public DataCacheItemVersion Version { get; } }

7

8 public DataCacheItemVersion Add(string key, object value, IEnumerable tags); public DataCacheItemVersion Add(string key, object value, IEnumerable tags, string region); public DataCacheItemVersion Add(string key, object value, TimeSpan timeout, IEnumerable tags); public DataCacheItemVersion Add(string key, object value, TimeSpan timeout, IEnumerable tags, string region); public DataCacheItemVersion Put(string key, object value, IEnumerable tags); public DataCacheItemVersion Put(string key, object value, IEnumerable tags, string region); public DataCacheItemVersion Put(string key, object value, TimeSpan timeout, IEnumerable tags); public DataCacheItemVersion Put(string key, object value, TimeSpan timeout, IEnumerable tags, string region);

9 public IEnumerable > GetObjectsByAllTags(IEnumerable tags, string region); public IEnumerable > GetObjectsByAnyTag(IEnumerable tags, string region); public IEnumerable > GetObjectsByTag(DataCacheTag tag, string region); public IEnumerable > GetObjectsInRegion(string region);

10

11


Download ppt "Working with Regions and Tags. var dcf = new DataCacheFactory(); //get the cache named "TestCache" var cache = dcf.GetCache("TestCache"); //Add a region."

Similar presentations


Ads by Google