SoftwareDriven.Persistence.IndexedDb 3.0.0

dotnet add package SoftwareDriven.Persistence.IndexedDb --version 3.0.0
                    
NuGet\Install-Package SoftwareDriven.Persistence.IndexedDb -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SoftwareDriven.Persistence.IndexedDb" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SoftwareDriven.Persistence.IndexedDb" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SoftwareDriven.Persistence.IndexedDb" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SoftwareDriven.Persistence.IndexedDb --version 3.0.0
                    
#r "nuget: SoftwareDriven.Persistence.IndexedDb, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SoftwareDriven.Persistence.IndexedDb@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SoftwareDriven.Persistence.IndexedDb&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SoftwareDriven.Persistence.IndexedDb&version=3.0.0
                    
Install as a Cake Tool

SoftwareDriven.Persistence.IndexedDb

Browser IndexedDB provider for SoftwareDriven.Persistence, designed for Blazor WebAssembly and Blazor Hybrid scenarios. Targets net8.0 and net10.0.

Installation

dotnet add package SoftwareDriven.Persistence.IndexedDb

Setup

// Program.cs
builder.Services.AddIndexedDb();
builder.Services.AddSingleton<IndexedDbRepositoryProvider<MyModel>>();

var host = builder.Build();

// Register object stores before connecting
var manager = host.Services.GetRequiredService<IndexedDbManager>();
manager.RegisterObjectStore<MyModel>();        // store name defaults to type name
manager.RegisterObjectStore<MyModel>("Items"); // or with custom store name
manager.RegisterFileStore("_files_Items");     // for file storage
await manager.Connect("MyDatabase");

await host.RunAsync();

Multi-instance (keyed DI)

builder.Services.AddIndexedDb("InstanceA");
builder.Services.AddIndexedDb("InstanceB");

var managerA = host.Services.GetRequiredKeyedService<IndexedDbManager>("InstanceA");

Usage

@inject IndexedDbRepositoryProvider<MyModel> Provider

// CRUD
await Provider.CreateOrUpdate(new MyModel { Title = "Hello" });
var item = await Provider.FindById("some-id");
var results = await Provider.FindByExpression(x => x.Title == "Hello");
await Provider.Delete("some-id");

// Pagination
var page = await Provider.GetAll(new PaginationOptions<MyModel>
{
    PageSize = 10,
    PageNumber = 0
});

// File storage (stored as Base64 in a separate object store)
await Provider.StoreFile("doc.pdf", fileBytes);
var data = await Provider.LoadFile("doc.pdf");
await Provider.DeleteFile("doc.pdf");

Important Notes

  • Object stores must be registered before Connect() is called, because IndexedDB only allows store creation during version upgrades.
  • Uses IJSRuntime for all IndexedDB operations via a bundled, minified JS module.
  • Expression-based queries load all records from the store and apply LINQ in-memory. This is efficient for typical client-side dataset sizes (hundreds to low thousands of records).
  • ID-based operations (FindById, Delete, CreateOrUpdate) use direct IndexedDB key lookups without loading all data.

Features

  • SupportsTotalCount: true
  • SupportsPagingState: false (offset-based pagination)
  • DefaultIdSource: GuidSource
  • Full IPersistenceProvider<T> support including nested collection projections, element match, and file storage

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 100 4/2/2026