Method StoreDifference
StoreDifference(String, String)
Take difference of current Set with the specified Set and store the result in a new destination Set.
Declaration
IDistributedHashSet<T> StoreDifference(string destination, string other)
Parameters
Type | Name | Description |
---|---|---|
System.String | destination | Name of a destination Set. |
System.String | other | Name of the Set to compare with. |
Returns
Type | Description |
---|---|
IDistributedHashSet<T> | Interface of destination Set handler. |
Examples
The following code sample shows how to get difference 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 differenceSet = "DifferenceSet";
// Set of MondayUsers already exists in cache.
IDistributedHashSet<int> result = set.StoreDifference(differenceSet, MondayUsersKey);