Method StoreIntersection
StoreIntersection(String, String)
Take intersection of current set with the specified set and store the result in a new destination set.
Declaration
IDistributedHashSet<T> StoreIntersection(string destination, string other)
Parameters
Type | Name | Description |
---|---|---|
System.String | destination | Name of destination set. |
System.String | other | Name of set to compare with. |
Returns
Type | Description |
---|---|
IDistributedHashSet<T> | Interface of destination set handler. |
Examples
The following code sample shows how to get intersection of a set with another set and store the result in cache.
ICache cache = CacheManager.GetCache("demoClusteredCache");
string MondayUsersKey = "MondayUsers";
string TuesdayUsersKey = "TuesdayUsers";
IDistributedHashSet<int> set = cache.DataTypeManager.GetHashSet<int>(TuesdayUsersKey);
string intersectionSet = "IntersectionSet";
// Set of MondayUsers already exists in cache.
IDistributedHashSet<int> result = set.StoreDifference(intersectionSet, MondayUsersKey);