Skip to content

Properties.TryAddToMultiple Method ​

Definition ​

Tries to add a value to a multiple valued property with the specified key. If the value already exists in the multiple then it is not added.

c#
public bool TryAddToMultiple<T>(string key, T value, IEqualityComparer<T>? valueComparer = null);

View source

Type Parameters ​

NameDescription
TThe type of the property.

Parameters ​

NameTypeDescription
keyStringThe key of the property.
valueTThe value to add to the property.
valueComparerIEqualityComparer<T>An equality comparer to compare values or null for the default comparer.

Returns ​

Boolean

true if the value was added, false otherwise.