ASP.NET Multi-Tenant SaaS App in 20 Minutes (EF Core) - Free Tutorial + GitHub Code Project

preview_player
Показать описание
Learn how to build a Multi-Tenant SaaS App using ASP.NET and Entity Framework Core. In less than 20 minutes understand the essential components that make up multi-tenant architecture using query filters and middleware. Multi-tenant architecture is essential for any SaaS or modern web application.

VIDEO PART 2:

TUTORIAL / SAMPLE CODE :

NANO ASP.NET BOILERPLATE:

VIDEO TOUR:

0:00 - Intro
0:42 - Set up CRUD application
5:35 - Begin Multi-Tenant Architecture (create tenant entity)
7:29 - Create IMustHaveTenant Interface
8:06 - Create Initial Migration
8:57 - Resolving Tenants in Request Header
10:20 - Middleware Tenant Resolver
11:16 - Scoped Service currentTenantService
13:07 - Modify ApplicationDbContext
14:05 - Add query filter in OnModelCreating
14:41 - Issue with Circular Dependency
15:23 - Create TenantDbContext
16:48 - Modify the Context in CurrentTenantSerice
17:01 - Run the App and Test with Postman
18:41 - Review the Request Flow with Breakpoints
21:20 - More Resources
Рекомендации по теме
Комментарии
Автор

Thank you soo much for the awesome video about Multi-Tenant.
Clear and crisp explanation.
Loved it!

PreethamM-diqk
Автор

Thanks a lot for the awesome video 👍
waiting to learn more about SaaS and Multi-Tenant.

Tamer_Ali
Автор

Deep dive tutorial 🎉 thanks efforts dude

emrekabali
Автор

Awesome, thanks a lot. It would be nice if there was a video for another example as well (Build a Multi-Tenant App With Multiple Databases)

brankogojkovic
Автор

Great stuff - if we can see how to do this using Identity for the authentication, sign up, etc., if would make this thing AWSOME!

CarCan
Автор

6:21 SQLServer is way slower working with a string as a primary key instead of an int.

larsp
Автор

ngl... that second DBContext feels like a hack.

joga_bonito_aro
Автор

Does this integrate with Azure AD (Entra ID) tenants?

nwoivny
Автор

good video, but that part of creating a second db context only for resolving the tenant of the request is pretty ugly to be honest.

SOYLUISO
Автор

This is good. But it can be hectic if we have lots of tenants. Can we extend this example to store tenant data in different schemas of the same database? And How?

umairmalpara
Автор

first off all thks a lot for these tutorial...
i have just one question:
when i tried to POST a new product, an was thrown saying that it can't insert a NULL value to TenantId Column, on Product table....
Should we add this information ( by claims for example) on Create endpoint/service?
i watched your tutorial twice and could not find any diferences on our code...
thanks alot!!!!

FelipeAlmeida-bckf
Автор

nice video! how do you prevent another tenant to use the key of someone else? are they supposed to be very difficult to find or is this a non issue?

ghevisartor
Автор

Here is me, asking myself what the fk is a Tenant. Good vid non the less tho.

LordErnie