Skip to content
Boris Zaikin edited this page Mar 4, 2018 · 4 revisions

Architecture

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.

Related links

Building Multi-tenant Web API using dot net core and best practices (Tutorial)

Clone this wiki locally