Skip to content
Docs Try Aspire

AspireDict

Handle
📦 Aspire.Hosting v13.2.0-preview.1.26159.1
interface AspireDict {
clear(): Promise<void>;
containsKey(key: K): Promise<boolean>;
count(): Promise<number>;
get(key: K): Promise<V>;
keys(): Promise<K[]>;
remove(key: K): Promise<boolean>;
set(
key: K,
value: V): Promise<void>;
toObject(): Promise<Record<string, V>>;
values(): Promise<V[]>;
}

Methods

method clear
Clears all key-value pairs
clear(): Promise<void>
Promise<void>
method containsKey
Determines whether the dictionary contains the specified key
containsKey(key: K): Promise<boolean>
key K
Promise<boolean>
method count
Gets the number of key-value pairs
count(): Promise<number>
Promise<number>
method get
Gets the value associated with the specified key
get(key: K): Promise<V>
key K
Promise<V>
method keys
Gets all keys in the dictionary
keys(): Promise<K[]>
Promise<K[]>
method remove
Removes the value with the specified key
remove(key: K): Promise<boolean>
key K
Promise<boolean>
method set
Sets the value for the specified key
set(
key: K,
value: V): Promise<void>
key K
value V
Promise<void>
method toObject
Converts the dictionary to a plain object (creates a copy)
toObject(): Promise<Record<string, V>>
Promise<Record<string, V>>
method values
Gets all values in the dictionary
values(): Promise<V[]>
Promise<V[]>