ManuHub.IndexedDB
1.1.0
Prefix Reserved
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
<PackageReference Include="ManuHub.IndexedDB" Version="1.1.0" />
<PackageVersion Include="ManuHub.IndexedDB" Version="1.1.0" />
<PackageReference Include="ManuHub.IndexedDB" />
paket add ManuHub.IndexedDB --version 1.1.0
#r "nuget: ManuHub.IndexedDB, 1.1.0"
#:package ManuHub.IndexedDB@1.1.0
#addin nuget:?package=ManuHub.IndexedDB&version=1.1.0
#tool nuget:?package=ManuHub.IndexedDB&version=1.1.0
📦 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
IndexedDbContextsetup - Improved dependency injection experience
- Reduced manual
IJSRuntimeboilerplate - 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 | Versions 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. |
-
net10.0
- Microsoft.AspNetCore.Components.Web (>= 10.0.8)
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.27)
-
net9.0
- Microsoft.AspNetCore.Components.Web (>= 9.0.16)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.