Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move warning to the top of the section #3843

Merged
merged 1 commit into from
May 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions entity-framework/core/miscellaneous/multitenancy.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ Notice that the [service lifetime](/dotnet/core/extensions/dependency-injection#

## Multiple schemas

> [!WARNING]
> This scenario is not directly supported by EF Core and is not a recommended solution.

In a different approach, the same database may handle `tenant1` and `tenant2` by using table schemas.

- **Tenant1** - `tenant1.CustomerData`
Expand All @@ -77,9 +80,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) =>
modelBuilder.Entity<CustomerData>().ToTable(nameof(CustomerData), tenant);
```

> [!WARNING]
> This scenario is not directly supported by EF Core and is not a recommended solution.

## Multiple databases and connection strings

The multiple database version is implemented by passing a different connection string for each tenant. This can be configured at startup by resolving the service provider and using it to build the connection string. A connection string by tenant section is added to the `appsettings.json` configuration file.
Expand Down