Class CollectionExtensions
Extension methods for ICollection
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Collections
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
public static class CollectionExtensions
Methods
AddRange<T>(ICollection<T>, IEnumerable<T>)
Add multiple items to a collection
Declaration
public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | collection | The collection to add to |
IEnumerable<T> | items | The items to add |
Type Parameters
Name | Description |
---|---|
T | The item type |
ContainsAll<T>(ICollection<T>, IEnumerable<T>)
Test if a collection contains multiple items
Declaration
public static bool ContainsAll<T>(this ICollection<T> collection, IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | collection | The collection |
IEnumerable<T> | items | The items to search for |
Returns
Type | Description |
---|---|
Boolean | True if the collection contains all items. |
Type Parameters
Name | Description |
---|---|
T | The item type |
ContainsAny<T>(ICollection<T>, IEnumerable<T>)
Test if a collection contains any of multiple items
Declaration
public static bool ContainsAny<T>(this ICollection<T> collection, IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | collection | The collection |
IEnumerable<T> | items | The items to search for |
Returns
Type | Description |
---|---|
Boolean | True if the collection contains any item in items. |
Type Parameters
Name | Description |
---|---|
T | The item type |