entityframework-dotnet-separate-tenant-db

Configure isolated per-tenant database access for ASP.NET Core Jarvis applications.

12|2|Updated May 4, 2020
One-click install
npx skills add https://github.com/hoangnh2412/jarvis --skill entityframework-dotnet-separate-tenant-db
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: entityframework-dotnet-separate-tenant-db
Source: https://github.com/hoangnh2412/jarvis/tree/main/.opencode/skills/entityframework-dotnet/patterns/separate-tenant-db
Command: npx skills add https://github.com/hoangnh2412/jarvis --skill entityframework-dotnet-separate-tenant-db

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the manual, error-prone work of configuring isolated per-tenant database access for multi-tenant ASP.NET Core applications built with the Jarvis framework, removing the need to manually wire up dependency injection and dynamic connection string routing for each tenant's dedicated database.

Core Features & Use Cases

  • Master DbContext Registration: Sets up a master database to store tenant identifiers and their unique connection strings for centralized metadata management.
  • Per-Tenant DbContext Configuration: Registers a dedicated App DbContext with a DbTenantConnectionStringResolver to automatically route requests to the correct tenant's isolated database.
  • Background Job Support: Provides guidance for switching DbContext instances per tenant in background jobs to ensure data isolation during asynchronous operations.
  • Use Case: Ideal for SaaS products built with Jarvis that require strict data separation between tenants, such as multi-tenant e-commerce or SaaS management platforms.

Quick Start

Use the entityframework-dotnet-separate-tenant-db skill to configure master and per-tenant DbContext registrations for your Jarvis multi-tenant application with isolated tenant databases.

Frequently Asked Questions about entityframework-dotnet-separate-tenant-db

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure isolated per-tenant databases in a multi-tenant ASP.NET Core application?

To configure isolated per-tenant databases in a multi-tenant ASP.NET Core application, you register a master DbContext for tenant identifiers and a dedicated App DbContext with a DbTenantConnectionStringResolver for dynamic request routing.

What is database-per-tenant isolation in Entity Framework Core?

Database-per-tenant isolation in Entity Framework Core is an architecture where each tenant receives a dedicated database, ensuring strict data separation by dynamically routing connection strings based on tenant identifiers stored in a master database.

Can I use Entity Framework Core with the Jarvis framework for multi-tenant SaaS data separation?

Yes, you can use Entity Framework Core with the Jarvis framework for multi-tenant SaaS data separation by registering master and per-tenant App DbContexts to route requests to isolated tenant databases automatically.

How do I maintain tenant data isolation during background job execution in EF Core?

To maintain tenant data isolation during background job execution in EF Core, you must implement a scoped Unit of Work pattern that dynamically switches the DbContext instance per tenant for asynchronous operations.

What is the best way to store tenant connection strings for dynamic database routing in dotnet?

The best way to store tenant connection strings for dynamic database routing in dotnet is to use a centralized master database that maps tenant identifiers to their unique connection strings for per-tenant DbContext resolution.