อ่านในภาษาอังกฤษ แก้ไข

แชร์ผ่าน


ConditionalWeakTable<TKey,TValue>.AddOrUpdate(TKey, TValue) Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Adds the key and value if the key doesn't exist, or updates the existing key's value if it does exist.

public:
 void AddOrUpdate(TKey key, TValue value);
public void AddOrUpdate (TKey key, TValue value);
member this.AddOrUpdate : 'Key * 'Value -> unit
Public Sub AddOrUpdate (key As TKey, value As TValue)

Parameters

key
TKey

The key to add or update. May not be null.

value
TValue

The value to associate with key.

Exceptions

key is null.

Applies to

ผลิตภัณฑ์ เวอร์ชัน
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.1