BlazoredLocalStorage 0.3.1

A library to provide access to local storage in Blazor applications

The owner has unlisted this package. This could mean that the package is deprecated or shouldn't be used anymore.
Install-Package BlazoredLocalStorage -Version 0.3.1
dotnet add package BlazoredLocalStorage --version 0.3.1
<PackageReference Include="BlazoredLocalStorage" Version="0.3.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BlazoredLocalStorage --version 0.3.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

BlazoredLocalStorage

A library to provide access to local storage in Blazor applications

NuGet

Installing

You can install from Nuget using the following command:

Install-Package BlazoredLocalStorage

Or via the Visual Studio package manger.

Setup

First, you will need to register local storage with the service collection in your startup.cs file

public void ConfigureServices(IServiceCollection services)
{
    services.AddLocalStorage();
}

Usage

This is an example of using local storage in a .cshtml file

@inject Blazored.Storage.ILocalStorage localStorage

@functions {

    protected override async Task OnInitAsync()
    {
        await localStorage.SetItem("name", "John Smith");
        var name = await localStorage.GetItem<string>("name");
    }

}

The APIs available are

  • SetItem()
  • GetItem()
  • RemoveItem()
  • Clear()
  • Length()
  • Key()

All APIs are now async

Note: Blazored.LocalStorage methods will handle the serialisation and de-serialisation of the data for you.

BlazoredLocalStorage

A library to provide access to local storage in Blazor applications

NuGet

Installing

You can install from Nuget using the following command:

Install-Package BlazoredLocalStorage

Or via the Visual Studio package manger.

Setup

First, you will need to register local storage with the service collection in your startup.cs file

public void ConfigureServices(IServiceCollection services)
{
    services.AddLocalStorage();
}

Usage

This is an example of using local storage in a .cshtml file

@inject Blazored.Storage.ILocalStorage localStorage

@functions {

    protected override async Task OnInitAsync()
    {
        await localStorage.SetItem("name", "John Smith");
        var name = await localStorage.GetItem<string>("name");
    }

}

The APIs available are

  • SetItem()
  • GetItem()
  • RemoveItem()
  • Clear()
  • Length()
  • Key()

All APIs are now async

Note: Blazored.LocalStorage methods will handle the serialisation and de-serialisation of the data for you.

Showing the top 1 GitHub repositories that depend on BlazoredLocalStorage:

Repository Stars
aspnet/Benchmarks
Benchmarks for ASP.NET Core

Version History

Version Downloads Last updated