Method Intersect
Intersect(String)
Returns the intersection of current set with the specified set.
Declaration
IEnumerable<T> Intersect(string other)
Parameters
Type | Name | Description |
---|---|---|
System.String | other | Name of set to compare with. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | Intersection of current set with the specified set. |
Examples
The following code sample shows how to get intersection of a set with another set.
ICache cache = CacheManager.GetCache("demoClusteredCache");
string MondayUsersKey = "MondayUsers";
string TuesdayUsersKey = "TuesdayUsers";
IDistributedHashSet<int> set = cache.DataTypeManager.GetHashSet<int>(TuesdayUsersKey);
// Set of MondayUsers already exists in cache.
IEnumerable<int> result = set.Intersect(MondayUsers);