Collapse All Expand All

C#

Oracle® Coherence .NET API Reference
CollectionUtils..::.Add Method (ICollection, Object)
CollectionUtils Class See Also

Oracle® Coherence .NET API Reference Release 3.6.1
E18812-01
Adds a new element to the specified collection.

Namespace: Tangosol.Util
Assembly: Coherence (in Coherence.dll) Version: 3.6.1.0 (3.6.1.0)

# Syntax

C#
    public static bool Add(
    	ICollection target,
    	Object obj
    )

#### Parameters

target
  Type: System.Collections..::.ICollection
  Collection where the new element will be added.

obj
  Type: System..::.Object
  Object to add.

#### Return Value

true if the element was added, false otherwise.

# Remarks

This method allows us to add element to any collection type from the System.Collections namespace in a uniform manner, thus hiding differences in the API between IList implementations and classes such as Queue and Stack. When collection is IDictionary object should be DictionaryEntry.

# Exceptions

Exception | Condition
--- | ---
System..::.NotSupportedException | If target is a fixed-size collection, or if its type is an unknown collection type.

# See Also

CollectionUtils Class
Add Overload
Tangosol.Util Namespace