TryAdd Method
Definition
- Namespace
- Cuemon.Extensions.Collections.Generic
- Assemblies
- Cuemon.Extensions.Collections.Generic.dll
TryAdd<T>(IList<T>, T)
Attempts to add the specified item to the list.
public static bool TryAdd<T>(this IList<T> list, T item)
Parameters
Returns
- bool
trueif the item was added to thelistsuccessfully,falseotherwise.
Type Parameters
T
Remarks
This method will add the specified item to the list if it is not already present.