Class CollectionExtensions
Utility extensions for collections.
Namespace: Holoride.ElasticSDK
Assembly: Holoride.ElasticSDK.Runtime.dll
Syntax
public static class CollectionExtensions
Methods
AddDistinct<T>(ICollection<T>, T)
Adds an element to a collection if the collection does not yet contain the element.
Declaration
public static void AddDistinct<T>(this ICollection<T> self, T element)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | self | The collection to add the element to. |
T | element | The element to add to the collection. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the collection. |
AddRangeDistinct<T>(ICollection<T>, IEnumerable<T>)
Adds each element in the list of elements to a collection if the collection does not yet contain the element.
Declaration
public static void AddRangeDistinct<T>(this ICollection<T> self, IEnumerable<T> elements)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | self | The collection to add the elements to. |
IEnumerable<T> | elements | The elements to add to the collection. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the collection. |