You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: UpdateToVersion3.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
# Migrating AuthPermissions.AspNetCore 2.* to 3.0
2
2
3
-
Version 3 of the AuthPermissions.AspNetCore library (shortened to **AuthP** from now on) contains a new sharding feature for multi-tenant applications. Please read the article called [Part6: Using sharding to build multi-tenant apps using EF Core and ASP.NET Core] LINK NEEDED for a detailed explanation of sharding and how AuthP library provides a sharding implementation.
3
+
Version 3 of the AuthPermissions.AspNetCore library (shortened to **AuthP** from now on) contains a new sharding feature for multi-tenant applications. Please read the article called [Part6: Using sharding to build multi-tenant apps using EF Core and ASP.NET Core] LINK ??? for a detailed explanation of sharding and how AuthP library provides a sharding implementation.
4
4
5
5
This article explains how to update an existing AuthPermissions.AspNetCore 2.* project to AuthPermissions.AspNetCore 3.0. I assume that you are using Visual Studio.
6
6
7
7
## TABLE OF CONTENT
8
8
9
9
These are things you need to do to update aan application using AuthP version 2.0 to
10
10
11
-
-**BRAKING CHANGE**: [Update your ITenantChangeService code]
12
-
-**Automatically applied**:
11
+
-**BRAKING CHANGE**: [Update your ITenantChangeService code](https://github.com/JonPSmith/AuthPermissions.AspNetCore/blob/main/UpdateToVersion3.md#braking-change-update-your-itenantchangeservice-code)
12
+
-**Automatically applied**:
13
13
The AuthP DbContext requires a migration to add some new properties in the `AuthUser` and `Tenant` classes. This is a non-breaking migration and will be automatically applied to the AuthP database on startup.
14
14
15
15
## BRAKING CHANGE: Update your `ITenantChangeService` code
@@ -22,6 +22,8 @@ Here are the main changes:
22
22
23
23
The new approach to obtaining a instance of your application's DbContext is to use DI injection via the class's constructor. This removes the need for the `GetNewInstanceOfAppContext` method. See the code below from Example3 shows how to inject the application's DbContext using DI - NOTE: The logger is optional - I use it to log any problems in my code.
24
24
25
+
**NOTE:** The documentation contains a page called [Building a tenant change service](https://github.com/JonPSmith/AuthPermissions.AspNetCore/wiki/Building-a-tenant-change-service) that you might like to look at.
@@ -61,4 +63,4 @@ For instance, in Example3's tenant change service it uses a transaction in the D
61
63
62
64
Inahierarchicalmulti-tenantapplicationyouwillnowhavemultipletenantstodeleteormove, andallthosechangesshouldbedonewithinonetransaction - seethe [RetailTenantChangeService](https://github.com/JonPSmith/AuthPermissions.AspNetCore/blob/main/Example4.ShopCode/EfCoreCode/RetailTenantChangeService.cs) example for how this is done.
0 commit comments