This is the source code for the YouTube video Is Your .NET App Multi-Tenant Yet? Learn How!. In this video, we will learn how to implement multi-tenancy in a .NET application. We will start with a simple Todo application and then add multi-tenancy to it. We will also learn how to use the HttpContext to get the current tenant in the application.
Is Your .NET App Multi-Tenant Yet? Learn How!
The main solution file is MultiTenancy.sln, and the source code is located in the MultiTenancy directory. Here are some key files:
Program.cs: The entry point of the application.TenancyManager.cs: Manages the tenants in the application.TenancyMiddleware.cs: Middleware for handling multi-tenancy.TodoDbContext.cs: The DbContext for the Todo application.appsettings.json: Contains the application settings.
To get started with the project, follow these steps:
- Clone the repository.
- Run
dotnet runto start the application.
Please ensure you have .NET 8 installed on your machine before you proceed.
This project is licensed under the MIT License - see the LICENSE file for details.