Table of Contents

Method LoadObjectAsync

Namespace
WhalesSecret.TradeScriptLib.API
Assembly
WhalesSecret.TradeScriptLib.dll

LoadObjectAsync<TValue>(byte[])

Loads an object, identified by the given key, from the persistent script storage.

Task<TValue?> LoadObjectAsync<TValue>(byte[] key)

Parameters

key byte[]

Key under which the object is stored.

Returns

Task<TValue>

Deserialized object loaded from the storage or null if there is no data stored under the given key.

Type Parameters

TValue

Type of the object to load.

Exceptions

SerializationException

Thrown if the object cannot be deserialized from the byte array value stored in the storage.

DatabaseErrorException

Thrown if a database error occurred.

InvalidArgumentException

Thrown if key is null.

LoadObjectAsync<TValue>(string)

Loads an object, identified by the given key, from the persistent script storage.

Task<TValue?> LoadObjectAsync<TValue>(string key)

Parameters

key string

Key under which the object is stored. They key is interpreted as UTF-8 string and converted to a binary representation.

Returns

Task<TValue>

Deserialized object loaded from the storage or null if there is no data stored under the given key.

Type Parameters

TValue

Type of the object to load.

Exceptions

SerializationException

Thrown if the object cannot be deserialized from the byte array value stored in the storage.

DatabaseErrorException

Thrown if a database error occurred.

InvalidArgumentException

Thrown if key is null.