abp-multi-tenancy

Manage ABP Framework multi-tenancy with IMultiTenant and ICurrentTenant.

14.4k|3.7k|Updated Dec 3, 2016
One-click install
npx skills add https://github.com/abpframework/abp --skill abp-multi-tenancy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: abp-multi-tenancy
Source: https://github.com/abpframework/abp/tree/main/.claude/skills/abp-multi-tenancy
Command: npx skills add https://github.com/abpframework/abp --skill abp-multi-tenancy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexities of managing data isolation and context switching in multi-tenant applications built with the ABP Framework, ensuring data privacy and efficient tenant operations.

Core Features & Use Cases

  • Tenant-Aware Entities: Make your data models aware of tenants by implementing IMultiTenant.
  • Current Tenant Context: Access and manipulate the current tenant's information (ICurrentTenant).
  • Tenant Switching: Temporarily switch between tenants or to the host context using CurrentTenant.Change().
  • Data Filtering: Understand how ABP automatically filters data by the current tenant and how to disable this filter when necessary.
  • Database Strategies: Explore options like single database, database per tenant, or hybrid approaches.

Quick Start

Use the abp-multi-tenancy skill to implement the IMultiTenant interface for a new Product entity.

Frequently Asked Questions about abp-multi-tenancy

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

FAQPage Schema
How do I implement multi-tenancy in ASP.NET Core using ABP Framework?

Multi-tenancy in ABP Framework is implemented by adding the IMultiTenant interface to your entities. This allows the framework to automatically handle tenant data isolation and filter data based on the current tenant context.

How do I access and switch the current tenant in ABP Framework?

Access the current tenant using ICurrentTenant and switch contexts temporarily using CurrentTenant.Change(). This enables you to execute operations for a specific tenant or switch to the host context when needed.

How does ABP Framework handle multi-tenant data filtering?

ABP Framework automatically filters data based on the current tenant context for entities implementing IMultiTenant. You can manually disable this data filter when you need to query data across multiple tenants.

What database strategies does ABP Framework support for tenant isolation?

ABP Framework supports multiple database strategies for tenant isolation, including a single database for all tenants, a database per tenant approach, or hybrid database strategies to accommodate varying application scales.

When should I use the database-per-tenant strategy in ABP multi-tenancy?

The database-per-tenant strategy in ABP multi-tenancy is ideal when you require strict physical data isolation between tenants. It provides maximum data privacy but requires more complex database management compared to a shared database approach.

Does ABP multi-tenancy support C# and ASP.NET Core applications?

Yes, ABP multi-tenancy is designed for C# and ASP.NET Core applications. It provides native abstractions like IMultiTenant and ICurrentTenant to manage tenant isolation seamlessly within the ABP Framework ecosystem.