BlazoredLocalStorage 0.3.1

.NET Standard 2.0
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities 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.
#r "nuget: BlazoredLocalStorage, 0.3.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install BlazoredLocalStorage as a Cake Addin
#addin nuget:?package=BlazoredLocalStorage&version=0.3.1

// Install BlazoredLocalStorage as a Cake Tool
#tool nuget:?package=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.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on BlazoredLocalStorage:

Repository Stars
aspnet/Benchmarks
Benchmarks for ASP.NET Core
Version Downloads Last updated