ManuHub.IndexedDB 1.1.0

Prefix Reserved
Suggested Alternatives

ManuHub.IndexedDB 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ManuHub.IndexedDB --version 1.1.0
                    
NuGet\Install-Package ManuHub.IndexedDB -Version 1.1.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="ManuHub.IndexedDB" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ManuHub.IndexedDB" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ManuHub.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 ManuHub.IndexedDB --version 1.1.0
                    
#r "nuget: ManuHub.IndexedDB, 1.1.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 ManuHub.IndexedDB@1.1.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=ManuHub.IndexedDB&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=ManuHub.IndexedDB&version=1.1.0
                    
Install as a Cake Tool

Static Badge NuGet Version NuGet Downloads

📦 ManuHub.IndexedDB

v1.1
A lightweight, production-ready IndexedDB wrapper for Blazor WebAssembly with a clean EF-Core-inspired API.


🚀 Overview

ManuHub.IndexedDB provides a simple and strongly structured API for working with browser IndexedDB in Blazor WASM applications.

It abstracts JavaScript interop complexity and offers a clean .NET-first developer experience.


♻️ Changelog v1.1.0

Added

  • Added AddIndexedDb<TContext>() service registration extension

Improved

  • Simplified IndexedDbContext setup
  • Improved dependency injection experience
  • Reduced manual IJSRuntime boilerplate
  • Improved EF Core–style architecture and usability

✨ Features (V1)

✔ Full CRUD support (Add / Get / Update / Delete)
✔ Batch operations (AddRange / UpdateRange / DeleteRange)
✔ EF-style DbContext pattern
✔ Clean JS interop abstraction
✔ IndexedDB schema initialization
✔ Safe transaction handling
✔ GUID/string key support
✔ Blazor WebAssembly optimized
✔ Lightweight & dependency-free


📦 Installation

dotnet add package ManuHub.IndexedDB

⚙️ Setup

1. Register DbContext

builder.Services.AddIndexedDb<AppDbContext>();

2. Create DbContext

public class AppDbContext : IndexedDbContext
{
    public AppDbContext()
        : base(new IndexedDbOptions
        {
            DatabaseName = "SampleDB",
            Version = 1
        })
    {
    }

    public IndexedSet<TodoItem> Todos => Set<TodoItem>("todos");
}

OR

public class AppDbContext : IndexedDbContext
{
    public AppDbContext(ILogger<AppDbContext> logger)
        : base(new IndexedDbOptions
        {
            DatabaseName = "SampleDB",
            Version = 1
        }, logger)
    {
    }

    // -----------------------------------------------------
    // ENTITY REGISTRY
    // -----------------------------------------------------

    protected override IEnumerable<Type> GetEntityTypes()
    {
        yield return typeof(TodoItem);

        // Add more entity types here as needed
    }

    // -----------------------------------------------------
    // STORES
    // -----------------------------------------------------

    public IndexedSet<TodoItem> Todos => Set<TodoItem>("todos");

    // Add more stores here as needed

    // -----------------------------------------------------
    // OPTIONAL: Query access (clean API)
    // -----------------------------------------------------
    public IndexedQuery<TodoItem> TodoQuery => Query<TodoItem>("todos");

    // Add more queries here as needed
}

3. Define Model

[IndexedStore("todos")]
public class TodoItem
{
    [IndexedKey]
    public Guid Id { get; set; } = Guid.NewGuid();

    public string Title { get; set; } = "";

    public bool IsDone { get; set; }
}

🧪 Basic Usage

➕ Add

await Db.Todos.AddAsync(new TodoItem
{
    Title = "Learn IndexedDB.NET"
});

📖 Get All

var items = await Db.Todos.GetAllAsync();

✏️ Update

item.Title = "Updated";
await Db.Todos.UpdateAsync(item);

❌ Delete

await Db.Todos.DeleteAsync(item.Id);

⚡ Batch Operations

➕ Add Range

await Db.Todos.AddRangeAsync(items);

✏️ Update Range

await Db.Todos.UpdateRangeAsync(items);

❌ Delete Range

await Db.Todos.DeleteRangeAsync(items.Select(x => x.Id));

🧠 Architecture

ManuHub.IndexedDB uses a layered design:

Blazor App
   ↓
IndexedDbContext (C#)
   ↓
IndexedSet<T>
   ↓
JS Interop Layer
   ↓
IndexedDB Browser API

⚠️ Version 1 Limitations

This is a V1 release focused on core stability.

Not included yet:

  • LINQ-style querying (Where, Select)
  • Change tracking / SaveChanges()
  • Relationships / navigation properties
  • Transactions API abstraction
  • Offline sync (MongoDB / REST)
  • Advanced indexing strategy
  • Aggregations / grouping
  • Multi-database orchestration

🧭 Roadmap (V2)

Planned improvements:

  • LINQ expression support
  • EF Core-style change tracking
  • Unit-of-work pattern
  • Offline sync engine (REST / MongoDB)
  • Query optimizer & index selection
  • Migration framework
  • Conflict resolution strategies

💡 Design Philosophy

“Make browser storage feel like EF Core — but lightweight, fast, and Blazor-native.”


🛠 Tech Stack

  • Blazor WebAssembly
  • IndexedDB (Browser API)
  • JavaScript ES Modules
  • .NET JSInterop

📄 License

MIT License


🤝 Contributing

Pull requests and suggestions are welcome. This project is designed to evolve toward a full EF-Core-like IndexedDB ORM.


⭐ Status

Version: 1.1.0
Stability: Production-ready (core CRUD)
Target: Blazor WebAssembly applications

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 is compatible.  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
1.2.0 47 5/28/2026
1.1.0 125 5/14/2026 1.1.0 is deprecated because it has critical bugs.
1.0.0 125 5/13/2026 1.0.0 is deprecated because it has critical bugs.