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: README.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,17 +10,16 @@ The AuthP is an open-source library under the MIT licence (and remain as a open-
10
10
11
11
## List of versions and which .NET framework they support
12
12
13
+
- Version 9.?.? supports NET 9 only (simpler to update to next NET release)
13
14
- Version 8.?.? supports NET 8 only (simpler to update to next NET release)
14
15
- Version 6.?.? supports NET 6, 7 and 8
15
16
- Version 5.?.? supports NET 6 and 7
16
17
17
18
If you have already built your application using an older version, then you need to look at the following "how up update" documents
18
19
20
+
- For AuthPermissions.AspNetCore versions below 9 see [UpdateToVersion9.md](https://github.com/JonPSmith/AuthPermissions.AspNetCore/blob/main/UpdateToVersion9.md)
19
21
- From Migrating from AuthPermissions.AspNetCore 3, 4, 5 to 6.1 see [UpdateToVersion620.md](https://github.com/JonPSmith/AuthPermissions.AspNetCore/blob/main/UpdateToVersion620.md). NOTE: you only need to do this if you are using the "Sign up for a new tenant, with versioning" (shortened to "Sign up Tenant") feature **AND** your multi-tenant uses [sharding](https://github.com/JonPSmith/AuthPermissions.AspNetCore/wiki/Sharding-explained).
20
22
- From Migrating from AuthPermissions.AspNetCore 3, 4, 5 to 6.0 see [UpdateToVersion6.md](https://github.com/JonPSmith/AuthPermissions.AspNetCore/blob/main/UpdateToVersion5.md)
21
-
- From Migrating from AuthPermissions.AspNetCore 2, 3 or 4.* to 5.0 see [UpdateToVersion5.md](https://github.com/JonPSmith/AuthPermissions.AspNetCore/blob/main/UpdateToVersion5.md)
22
-
- From Migrating from AuthPermissions.AspNetCore 2.* to 3.0 see [UpdateToVersion3.md](https://github.com/JonPSmith/AuthPermissions.AspNetCore/blob/main/UpdateToVersion3.md)
23
-
- From Migrating from AuthPermissions.AspNetCore 1.* to 1.0 see [UpdateToVersion2.md](https://github.com/JonPSmith/AuthPermissions.AspNetCore/blob/main/UpdateToVersion2.md)
# Updating your code from AuthPermissions.AspNetCore to EF Core 9
2
+
3
+
EF Core 9 has added code to ensure that migrations are executed correctly - see EF Core 9's [updated migrations](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-9.0/whatsnew#migrations). The AuthP library already have code to ensure that migrations are executed correctly, but one of the EF Core 9's changes is to check that only one migration is executed on a database. It does this to ensure that migrations don't clash.
4
+
5
+
AuthP does apply two migrations when building multi-tenant applications. This means you need to add a `OnConfiguring` the code shown to your tenant's `DbContext`. The code below comes from [Example3's tenant `DbContext`](https://github.com/JonPSmith/AuthPermissions.AspNetCore/blob/main/Example3.InvoiceCode/EfCoreCode/InvoicesDbContext.cs) - the new code for EF Core 9 is the new `OnConfiguring` method. See below.
NOTE: If you get an `InvalidOperationException` with the text shown below on startup, then you haven't added the `OnConfiguring` shown above, then you haven't added the code above.
34
+
35
+
```text
36
+
An error was generated for warning 'Microsoft.EntityFrameworkCore.Migrations.PendingModelChangesWarning': The model for context '-your tenant context-' has pending changes. Add a new migration before updating the database. This exception can be suppressed or logged by passing event ID 'RelationalEventId.PendingModelChangesWarning' to the 'ConfigureWarnings' method in 'DbContext.OnConfiguring' or 'AddDbContext'.
0 commit comments