-
-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: multitenant store fixups (#653)
multitenant store fixups
- Loading branch information
1 parent
375add5
commit 79d9124
Showing
52 changed files
with
1,559 additions
and
1,416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 46 additions & 15 deletions
61
src/Finbuckle.MultiTenant/Abstractions/IMultiTenantContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,54 @@ | ||
// Copyright Finbuckle LLC, Andrew White, and Contributors. | ||
// Refer to the solution LICENSE file for more inforation. | ||
|
||
namespace Finbuckle.MultiTenant | ||
// ReSharper disable once CheckNamespace | ||
namespace Finbuckle.MultiTenant; | ||
|
||
/// <summary> | ||
/// Non-generic interface for the multitenant context. | ||
/// </summary> | ||
public interface IMultiTenantContext | ||
{ | ||
public interface IMultiTenantContext | ||
{ | ||
ITenantInfo? TenantInfo { get; } | ||
bool HasResolvedTenant => TenantInfo != null; | ||
/// <summary> | ||
/// Information about the tenant for this context. | ||
/// </summary> | ||
ITenantInfo? TenantInfo { get; } | ||
|
||
/// <summary> | ||
/// True if a non-null tenant has been resolved. | ||
/// </summary> | ||
bool HasResolvedTenant => TenantInfo != null; | ||
|
||
StrategyInfo? StrategyInfo { get; } | ||
} | ||
/// <summary> | ||
/// Information about the multitenant strategies for this context. | ||
/// </summary> | ||
StrategyInfo? StrategyInfo { get; } | ||
} | ||
|
||
public interface IMultiTenantContext<T> | ||
where T : class, ITenantInfo, new() | ||
{ | ||
T? TenantInfo { get; set; } | ||
bool HasResolvedTenant => TenantInfo != null; | ||
/// <summary> | ||
/// Generic interface for the multitenant context. | ||
/// </summary> | ||
/// <typeparam name="T">The ITenantInfo implementation type.</typeparam> | ||
public interface IMultiTenantContext<T> | ||
where T : class, ITenantInfo, new() | ||
{ | ||
/// <summary> | ||
/// Information about the tenant for this context. | ||
/// </summary> | ||
T? TenantInfo { get; set; } | ||
/// <summary> | ||
/// Returns true if a non-null tenant has been resolved. | ||
/// </summary> | ||
bool HasResolvedTenant => TenantInfo != null; | ||
|
||
/// <summary> | ||
/// Information about the multitenant strategies for this context. | ||
/// </summary> | ||
StrategyInfo? StrategyInfo { get; set; } | ||
|
||
|
||
StrategyInfo? StrategyInfo { get; set; } | ||
StoreInfo<T>? StoreInfo { get; set; } | ||
} | ||
/// <summary> | ||
/// Information about the multitenant store(s) for this context. | ||
/// </summary> | ||
StoreInfo<T>? StoreInfo { get; set; } | ||
} |
17 changes: 8 additions & 9 deletions
17
src/Finbuckle.MultiTenant/Abstractions/IMultiTenantContextAccessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
// Copyright Finbuckle LLC, Andrew White, and Contributors. | ||
// Refer to the solution LICENSE file for more inforation. | ||
|
||
namespace Finbuckle.MultiTenant | ||
namespace Finbuckle.MultiTenant; | ||
|
||
public interface IMultiTenantContextAccessor | ||
{ | ||
public interface IMultiTenantContextAccessor | ||
{ | ||
IMultiTenantContext? MultiTenantContext { get; set; } | ||
} | ||
IMultiTenantContext? MultiTenantContext { get; set; } | ||
} | ||
|
||
public interface IMultiTenantContextAccessor<T> where T : class, ITenantInfo, new() | ||
{ | ||
IMultiTenantContext<T>? MultiTenantContext { get; set; } | ||
} | ||
public interface IMultiTenantContextAccessor<T> where T : class, ITenantInfo, new() | ||
{ | ||
IMultiTenantContext<T>? MultiTenantContext { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
// Copyright Finbuckle LLC, Andrew White, and Contributors. | ||
// Refer to the solution LICENSE file for more inforation. | ||
|
||
namespace Finbuckle.MultiTenant | ||
namespace Finbuckle.MultiTenant; | ||
|
||
public interface ITenantInfo | ||
{ | ||
public interface ITenantInfo | ||
{ | ||
string? Id { get; set; } | ||
string? Identifier { get; set; } | ||
string? Name { get; set; } | ||
string? ConnectionString { get; set; } | ||
} | ||
string? Id { get; set; } | ||
string? Identifier { get; set; } | ||
string? Name { get; set; } | ||
string? ConnectionString { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.