ProtectedBrowserStorage.SetAsync Method

Definition

Overloads

SetAsync(String, Object)

Asynchronously stores the specified data.

Since no data protection purpose is specified with this overload, the purpose is derived from key and the store name. This is a good default purpose to use if the keys come from a fixed set known at compile-time.

SetAsync(String, String, Object)

Asynchronously stores the supplied data.

SetAsync(String, Object)

Asynchronously stores the specified data.

Since no data protection purpose is specified with this overload, the purpose is derived from key and the store name. This is a good default purpose to use if the keys come from a fixed set known at compile-time.

public:
 System::Threading::Tasks::ValueTask SetAsync(System::String ^ key, System::Object ^ value);
public System.Threading.Tasks.ValueTask SetAsync (string key, object value);
member this.SetAsync : string * obj -> System.Threading.Tasks.ValueTask
Public Function SetAsync (key As String, value As Object) As ValueTask

Parameters

key
String

A String value specifying the name of the storage slot to use.

value
Object

A JSON-serializable value to be stored.

Returns

A ValueTask representing the completion of the operation.

Applies to

SetAsync(String, String, Object)

Asynchronously stores the supplied data.

public:
 System::Threading::Tasks::ValueTask SetAsync(System::String ^ purpose, System::String ^ key, System::Object ^ value);
public System.Threading.Tasks.ValueTask SetAsync (string purpose, string key, object value);
member this.SetAsync : string * string * obj -> System.Threading.Tasks.ValueTask
Public Function SetAsync (purpose As String, key As String, value As Object) As ValueTask

Parameters

purpose
String

A string that defines a scope for the data protection. The protected data can only be unprotected by code that specifies the same purpose.

key
String

A String value specifying the name of the storage slot to use.

value
Object

A JSON-serializable value to be stored.

Returns

A ValueTask representing the completion of the operation.

Applies to