ProtectedLocalStorage Class

Definition

Provides mechanisms for storing and retrieving data in the browser's 'localStorage' collection.

This data will be scoped to the current user's browser, shared across all tabs. The data will persist across browser restarts.

See: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage.

public ref class ProtectedLocalStorage sealed : Microsoft::AspNetCore::Components::Server::ProtectedBrowserStorage::ProtectedBrowserStorage
public sealed class ProtectedLocalStorage : Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage.ProtectedBrowserStorage
type ProtectedLocalStorage = class
    inherit ProtectedBrowserStorage
Public NotInheritable Class ProtectedLocalStorage
Inherits ProtectedBrowserStorage
Inheritance
ProtectedLocalStorage

Constructors

ProtectedLocalStorage(IJSRuntime, IDataProtectionProvider)

Constructs an instance of ProtectedLocalStorage.

Methods

DeleteAsync(String)

Asynchronously deletes any data stored for the specified key.

(Inherited from ProtectedBrowserStorage)
GetAsync<TValue>(String)

Asynchronously retrieves 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.

(Inherited from ProtectedBrowserStorage)
GetAsync<TValue>(String, String)

Asynchronously retrieves the specified data.

(Inherited from ProtectedBrowserStorage)
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.

(Inherited from ProtectedBrowserStorage)
SetAsync(String, String, Object)

Asynchronously stores the supplied data.

(Inherited from ProtectedBrowserStorage)

Applies to