Skip to content

Commit f1824bb

Browse files
committed
Minor updated to UpdateToVersion3
1 parent 86aa664 commit f1824bb

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

AuthPermissions.AspNetCore.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2020
ReleaseNotes.md = ReleaseNotes.md
2121
Roadmap.md = Roadmap.md
2222
UpdateToVersion2.md = UpdateToVersion2.md
23+
UpdateToVersion3.md = UpdateToVersion3.md
2324
EndProjectSection
2425
EndProject
2526
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example2.WebApiWithToken.IndividualAccounts", "Example2.WebApiWithToken.IndividualAccounts\Example2.WebApiWithToken.IndividualAccounts.csproj", "{E2667176-A75B-4182-94AF-43D8F0CF989A}"
@@ -36,7 +37,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example5.MvcWebApp.AzureAdB
3637
EndProject
3738
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example6.SingleLevelSharding", "Example6.SingleLevelSharding\Example6.SingleLevelSharding.csproj", "{9D89C5A6-3692-40A8-A83E-722D99C3004B}"
3839
EndProject
39-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example6.MvcWebApp.Sharding", "Example6.MvcWebApp.Sharding\Example6.MvcWebApp.Sharding.csproj", "{FCEA1BF4-C654-4AD1-A2BA-241DB153D3B4}"
40+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Example6.MvcWebApp.Sharding", "Example6.MvcWebApp.Sharding\Example6.MvcWebApp.Sharding.csproj", "{FCEA1BF4-C654-4AD1-A2BA-241DB153D3B4}"
4041
EndProject
4142
Global
4243
GlobalSection(SolutionConfigurationPlatforms) = preSolution

UpdateToVersion3.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Migrating AuthPermissions.AspNetCore 2.* to 3.0
22

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.
44

55
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.
66

77
## TABLE OF CONTENT
88

99
These are things you need to do to update aan application using AuthP version 2.0 to
1010

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**:
1313
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.
1414

1515
## BRAKING CHANGE: Update your `ITenantChangeService` code
@@ -22,6 +22,8 @@ Here are the main changes:
2222

2323
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.
2424

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.
26+
2527
```c#
2628
public class InvoiceTenantChangeService : ITenantChangeService
2729
{
@@ -61,4 +63,4 @@ For instance, in Example3's tenant change service it uses a transaction in the D
6163
6264
In a hierarchical multi-tenant application you will now have multiple tenants to delete or move, and all those changes should be done within one transaction - see the [RetailTenantChangeService](https://github.com/JonPSmith/AuthPermissions.AspNetCore/blob/main/Example4.ShopCode/EfCoreCode/RetailTenantChangeService.cs) example for how this is done.
6365
64-
END
66+
END

0 commit comments

Comments
 (0)