-
-
Notifications
You must be signed in to change notification settings - Fork 102
Home
Boris Zaikin edited this page Mar 4, 2018
·
4 revisions
Let’s briefly take a look at the architecture first. The example below is designed based on N-tire
architecture and has the following layers:
- Presentation layer or web api
- Service layer that will accommodate all the business logic
- Data access layer that is implemented using UnitOfWork and Repository patterns. As ORM in this example I used Entity Framework Core.
The key component of tenant separation is ContextFactory that contains logic to get the tenant id from HTTP header, retrieve a tenant database name using DataBaseManager and replace a database name in the connection string. As a result a database context (Entity Framework context) is created.
Building Multi-tenant Web API using dot net core and best practices (Tutorial)