Skip to content

Commit d1eb06f

Browse files
authored
Merge branch 'master' into a2a
2 parents cb6df20 + 6ce6105 commit d1eb06f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+719
-9
lines changed

BotSharp.sln

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.Plugin.Membase", "
155155
EndProject
156156
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.Core.A2A", "src\Infrastructure\BotSharp.Core.A2A\BotSharp.Core.A2A.csproj", "{E8D01281-D52A-BFF4-33DB-E35D91754272}"
157157
EndProject
158+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.Plugin.MultiTenancy", "src\Plugins\BotSharp.Plugin.MultiTenancy\BotSharp.Plugin.MultiTenancy.csproj", "{9BC8DF43-88D1-4C57-A678-AC0153BDF4EB}"
159+
EndProject
158160
Global
159161
GlobalSection(SolutionConfigurationPlatforms) = preSolution
160162
Debug|Any CPU = Debug|Any CPU
@@ -659,6 +661,14 @@ Global
659661
{E8D01281-D52A-BFF4-33DB-E35D91754272}.Release|Any CPU.Build.0 = Release|Any CPU
660662
{E8D01281-D52A-BFF4-33DB-E35D91754272}.Release|x64.ActiveCfg = Release|Any CPU
661663
{E8D01281-D52A-BFF4-33DB-E35D91754272}.Release|x64.Build.0 = Release|Any CPU
664+
{9BC8DF43-88D1-4C57-A678-AC0153BDF4EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
665+
{9BC8DF43-88D1-4C57-A678-AC0153BDF4EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
666+
{9BC8DF43-88D1-4C57-A678-AC0153BDF4EB}.Debug|x64.ActiveCfg = Debug|Any CPU
667+
{9BC8DF43-88D1-4C57-A678-AC0153BDF4EB}.Debug|x64.Build.0 = Debug|Any CPU
668+
{9BC8DF43-88D1-4C57-A678-AC0153BDF4EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
669+
{9BC8DF43-88D1-4C57-A678-AC0153BDF4EB}.Release|Any CPU.Build.0 = Release|Any CPU
670+
{9BC8DF43-88D1-4C57-A678-AC0153BDF4EB}.Release|x64.ActiveCfg = Release|Any CPU
671+
{9BC8DF43-88D1-4C57-A678-AC0153BDF4EB}.Release|x64.Build.0 = Release|Any CPU
662672
EndGlobalSection
663673
GlobalSection(SolutionProperties) = preSolution
664674
HideSolutionNode = FALSE
@@ -734,6 +744,7 @@ Global
734744
{394B858B-9C26-B977-A2DA-8CC7BE5914CB} = {4F346DCE-087F-4368-AF88-EE9C720D0E69}
735745
{13223C71-9EAC-9835-28ED-5A4833E6F915} = {53E7CD86-0D19-40D9-A0FA-AB4613837E89}
736746
{E8D01281-D52A-BFF4-33DB-E35D91754272} = {E29DC6C4-5E57-48C5-BCB0-6B8F84782749}
747+
{9BC8DF43-88D1-4C57-A678-AC0153BDF4EB} = {7C64208C-8D11-4E17-A3E9-14D7910763EB}
737748
EndGlobalSection
738749
GlobalSection(ExtensibilityGlobals) = postSolution
739750
SolutionGuid = {A9969D89-C98B-40A5-A12B-FC87E55B3A19}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace BotSharp.Abstraction.MultiTenancy;
2+
3+
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
4+
public class ConnectionStringNameAttribute : Attribute
5+
{
6+
public string Name { get; }
7+
8+
public ConnectionStringNameAttribute(string name)
9+
{
10+
Name = name;
11+
}
12+
13+
public static string GetConnStringName(Type type) => type.FullName ?? string.Empty;
14+
15+
public static string GetConnStringName<T>() => GetConnStringName(typeof(T));
16+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace BotSharp.Abstraction.MultiTenancy;
2+
3+
[Serializable]
4+
public class ConnectionStrings : Dictionary<string, string?>
5+
{
6+
public const string DefaultConnectionStringName = "Default";
7+
8+
public string? Default
9+
{
10+
get => this[DefaultConnectionStringName];
11+
set => this[DefaultConnectionStringName] = value;
12+
}
13+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace BotSharp.Abstraction.MultiTenancy;
2+
3+
public interface IConnectionStringResolver
4+
{
5+
string? GetConnectionString(string connectionStringName);
6+
7+
string? GetConnectionString<TContext>();
8+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace BotSharp.Abstraction.MultiTenancy;
2+
3+
public interface ICurrentTenant
4+
{
5+
Guid? Id { get; }
6+
7+
string? Name { get; }
8+
9+
string? TenantId => Id?.ToString();
10+
11+
IDisposable Change(Guid? id, string? name = null);
12+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace BotSharp.Abstraction.MultiTenancy;
2+
3+
public interface ITenantConnectionProvider
4+
{
5+
string GetConnectionString(string name);
6+
string GetDefaultConnectionString();
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace BotSharp.Abstraction.MultiTenancy;
2+
3+
public interface ITenantFeature
4+
{
5+
bool Enabled { get; }
6+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using BotSharp.Abstraction.MultiTenancy.Models;
2+
3+
namespace BotSharp.Abstraction.MultiTenancy;
4+
5+
public interface ITenantOptionProvider
6+
{
7+
Task<IReadOnlyList<TenantOption>> GetOptionsAsync();
8+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using BotSharp.Abstraction.MultiTenancy.Models;
2+
3+
namespace BotSharp.Abstraction.MultiTenancy;
4+
5+
public interface ITenantResolveContributor
6+
{
7+
string Name { get; }
8+
9+
Task<TenantResolveResult> ResolveAsync(TenantResolveContext context);
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using BotSharp.Abstraction.MultiTenancy.Models;
2+
3+
namespace BotSharp.Abstraction.MultiTenancy;
4+
5+
public interface ITenantResolver
6+
{
7+
Task<TenantResolveResult> ResolveAsync(TenantResolveContext context);
8+
}

0 commit comments

Comments
 (0)