Skip to content

Commit f53aa5c

Browse files
committed
5.0.0-preview020 - modified TenantChange interface
1 parent 33d60e0 commit f53aa5c

23 files changed

+68
-23
lines changed

AuthPermissions.AspNetCore/CreateNuGetDebug.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
33
<metadata>
44
<id>AuthPermissions.AspNetCore</id>
5-
<version>5.0.0-preview019debug</version>
5+
<version>5.0.0-preview020debug</version>
66
<authors>Jon P Smith</authors>
77
<product>AuthPermissions.AspNetCore</product>
88
<copyright>Copyright (c) 2021 Jon P Smith</copyright>

AuthPermissions.AspNetCore/MultiProjPack.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!-- See documentation for all the possible values -->
55
<metadata>
66
<id>AuthPermissions.AspNetCore</id>
7-
<version>5.0.0-preview019debug</version>
7+
<version>5.0.0-preview020debug</version>
88
<authors>Jon P Smith</authors>
99
<product>AuthPermissions.AspNetCore</product>
1010
<copyright>Copyright (c) 2021 Jon P Smith</copyright>

AuthPermissions.AspNetCore/ShardingServices/IAccessDatabaseInformationVer5.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) 2023 Jon P Smith, GitHub: JonPSmith, web: http://www.thereformedprogrammer.net/
22
// Licensed under MIT license. See License.txt in the project root for license information.
33

4+
using AuthPermissions.BaseCode;
45
using StatusGeneric;
56

67
namespace AuthPermissions.AspNetCore.ShardingServices;

AuthPermissions.AspNetCore/ShardingServices/IDatabaseSpecificMethods.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under MIT license. See License.txt in the project root for license information.
33

44
using System.ComponentModel;
5+
using AuthPermissions.BaseCode;
56
using AuthPermissions.BaseCode.SetupCode;
67
using StatusGeneric;
78

AuthPermissions.AspNetCore/ShardingServices/IShardingConnections.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) 2023 Jon P Smith, GitHub: JonPSmith, web: http://www.thereformedprogrammer.net/
22
// Licensed under MIT license. See License.txt in the project root for license information.
33

4+
using AuthPermissions.BaseCode;
45
using AuthPermissions.BaseCode.SetupCode;
56
using StatusGeneric;
67

AuthPermissions.AspNetCore/ShardingServices/PostgresDatabaseSpecificMethods.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under MIT license. See License.txt in the project root for license information.
33

44
using System.ComponentModel;
5+
using AuthPermissions.BaseCode;
56
using AuthPermissions.BaseCode.CommonCode;
67
using AuthPermissions.BaseCode.SetupCode;
78
using Medallion.Threading.Postgres;

AuthPermissions.AspNetCore/ShardingServices/ShardingSettingsOption.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) 2023 Jon P Smith, GitHub: JonPSmith, web: http://www.thereformedprogrammer.net/
22
// Licensed under MIT license. See License.txt in the project root for license information.
33

4+
using AuthPermissions.BaseCode;
5+
46
namespace AuthPermissions.AspNetCore.ShardingServices;
57

68
/// <summary>

AuthPermissions.AspNetCore/ShardingServices/SqlServerDatabaseSpecificMethods.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under MIT license. See License.txt in the project root for license information.
33

44
using System.ComponentModel;
5+
using AuthPermissions.BaseCode;
56
using AuthPermissions.BaseCode.CommonCode;
67
using AuthPermissions.BaseCode.SetupCode;
78
using Medallion.Threading.SqlServer;

AuthPermissions.AspNetCore/ShardingServices/DatabaseInformation.cs renamed to AuthPermissions.BaseCode/DatabaseInformation.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// Licensed under MIT license. See License.txt in the project root for license information.
33

44
using System.ComponentModel.DataAnnotations;
5-
using AuthPermissions.BaseCode;
65
using AuthPermissions.BaseCode.CommonCode;
76
using AuthPermissions.BaseCode.DataLayer.EfCode;
87
using AuthPermissions.BaseCode.SetupCode;
8+
using Microsoft.EntityFrameworkCore;
99

10-
namespace AuthPermissions.AspNetCore.ShardingServices;
10+
namespace AuthPermissions.BaseCode;
1111

1212
/// <summary>
1313
/// This class holds the information about each database used by the AuthP sharding feature
@@ -64,9 +64,6 @@ string GetShortDatabaseProviderName()
6464
case AuthPDatabaseTypes.PostgreSQL:
6565
return "PostgreSQL";
6666
case AuthPDatabaseTypes.CustomDatabase:
67-
if(authPContext == null)
68-
throw new AuthPermissionsException(
69-
"When using a custom database provide, then you must provide an instance of the AuthPermissionsDbContext context.");
7067
return authPContext.GetProviderShortName();
7168
default:
7269
throw new ArgumentOutOfRangeException();

AuthPermissions.AspNetCore/ShardingServices/ProviderNameExtension.cs renamed to AuthPermissions.BaseCode/ProviderNameExtension.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// Copyright (c) 2023 Jon P Smith, GitHub: JonPSmith, web: http://www.thereformedprogrammer.net/
22
// Licensed under MIT license. See License.txt in the project root for license information.
33

4+
using AuthPermissions.BaseCode.CommonCode;
45
using Microsoft.EntityFrameworkCore;
56

6-
namespace AuthPermissions.AspNetCore.ShardingServices;
7+
namespace AuthPermissions.BaseCode;
78

89
/// <summary>
9-
/// method to get the Database Provider short name
10+
/// Simple method to get the short name of a EF Core database provider
1011
/// </summary>
1112
public static class ProviderNameExtension
1213
{
@@ -18,6 +19,10 @@ public static class ProviderNameExtension
1819
/// <returns></returns>
1920
public static string GetProviderShortName(this DbContext context)
2021
{
22+
if (context == null)
23+
throw new AuthPermissionsException(
24+
"When using a custom database provide, then you must provide an instance of the AuthPermissionsDbContext context.");
25+
2126
var lastPart = context.Database.ProviderName!.Split('.').Last();
2227
if (lastPart == "EntityFrameworkCore")
2328
{

0 commit comments

Comments
 (0)