diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/en-GB.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/en-GB.json
index c1f56de865..c20405a8d3 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/en-GB.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/en-GB.json
@@ -9,6 +9,7 @@
"OfficialBlog": "Official blog",
"CommercialHomePage": "Commercial home page",
"CommercialSupportWebSite": "Commercial support web site",
- "CommunityWebSite": "ABP community web site"
+ "CommunityWebSite": "ABP community web site",
+ "ManageAccount": "My Account | ABP.IO"
}
}
\ No newline at end of file
diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/en.json
index eb49443d6e..c4581a5fd8 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/en.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/en.json
@@ -9,6 +9,7 @@
"OfficialBlog": "Official blog",
"CommercialHomePage": "Commercial home page",
"CommercialSupportWebSite": "Commercial support web site",
- "CommunityWebSite": "ABP community web site"
+ "CommunityWebSite": "ABP community web site",
+ "ManageAccount": "My Account | ABP.IO"
}
}
\ No newline at end of file
diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/tr.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/tr.json
index e403e72cf6..a7fec38074 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/tr.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/tr.json
@@ -9,6 +9,7 @@
"OfficialBlog": "Resmi blog",
"CommercialHomePage": "Kurumsal ana sayfa",
"CommercialSupportWebSite": "Kurumsal destek web sitesi",
- "CommunityWebSite": "ABP topluluk web sitesi"
+ "CommunityWebSite": "ABP topluluk web sitesi",
+ "ManageAccount": "Hesabım | ABP.IO"
}
}
\ No newline at end of file
diff --git a/framework/Volo.Abp.sln b/framework/Volo.Abp.sln
index e47fccb8f2..667421e14e 100644
--- a/framework/Volo.Abp.sln
+++ b/framework/Volo.Abp.sln
@@ -383,6 +383,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.TextTemplating.Scr
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.MongoDB.Tests.SecondContext", "test\Volo.Abp.MongoDB.Tests.SecondContext\Volo.Abp.MongoDB.Tests.SecondContext.csproj", "{90B1866A-EF99-40B9-970E-B898E5AA523F}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.IdentityModel.Tests", "test\Volo.Abp.IdentityModel.Tests\Volo.Abp.IdentityModel.Tests.csproj", "{40C6740E-BFCA-4D37-8344-3D84E2044BB2}"
+EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Threading.Tests", "test\Volo.Abp.Threading.Tests\Volo.Abp.Threading.Tests.csproj", "{7B2FCAD6-86E6-49C8-ADBE-A61B4F4B101B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Auditing.Contracts", "src\Volo.Abp.Auditing.Contracts\Volo.Abp.Auditing.Contracts.csproj", "{508B6355-AD28-4E60-8549-266D21DBF2CF}"
@@ -1145,6 +1147,10 @@ Global
{90B1866A-EF99-40B9-970E-B898E5AA523F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90B1866A-EF99-40B9-970E-B898E5AA523F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90B1866A-EF99-40B9-970E-B898E5AA523F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {40C6740E-BFCA-4D37-8344-3D84E2044BB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {40C6740E-BFCA-4D37-8344-3D84E2044BB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {40C6740E-BFCA-4D37-8344-3D84E2044BB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {40C6740E-BFCA-4D37-8344-3D84E2044BB2}.Release|Any CPU.Build.0 = Release|Any CPU
{7B2FCAD6-86E6-49C8-ADBE-A61B4F4B101B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B2FCAD6-86E6-49C8-ADBE-A61B4F4B101B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B2FCAD6-86E6-49C8-ADBE-A61B4F4B101B}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1346,6 +1352,7 @@ Global
{C996F458-98FB-483D-9306-4701290E2FC1} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{75D8DADB-3FA9-4C1D-B23A-DBFD08133B7C} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{90B1866A-EF99-40B9-970E-B898E5AA523F} = {447C8A77-E5F0-4538-8687-7383196D04EA}
+ {40C6740E-BFCA-4D37-8344-3D84E2044BB2} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{7B2FCAD6-86E6-49C8-ADBE-A61B4F4B101B} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{508B6355-AD28-4E60-8549-266D21DBF2CF} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
EndGlobalSection
diff --git a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpRabbitMqBackgroundJobOptions.cs b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpRabbitMqBackgroundJobOptions.cs
index 8d588debe9..82c505f050 100644
--- a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpRabbitMqBackgroundJobOptions.cs
+++ b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpRabbitMqBackgroundJobOptions.cs
@@ -15,10 +15,16 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
///
public string DefaultQueueNamePrefix { get; set; }
+ ///
+ /// Default value: "AbpBackgroundJobsDelayed."
+ ///
+ public string DefaultDelayedQueueNamePrefix { get; set;}
+
public AbpRabbitMqBackgroundJobOptions()
{
JobQueues = new Dictionary();
DefaultQueueNamePrefix = "AbpBackgroundJobs.";
+ DefaultDelayedQueueNamePrefix = "AbpBackgroundJobsDelayed.";
}
}
}
diff --git a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs
index 3d7e8c05ff..1d16e12683 100644
--- a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs
+++ b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
@@ -64,7 +65,8 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
return AbpRabbitMqBackgroundJobOptions.JobQueues.GetOrDefault(typeof(TArgs)) ??
new JobQueueConfiguration(
typeof(TArgs),
- AbpRabbitMqBackgroundJobOptions.DefaultQueueNamePrefix + JobConfiguration.JobName
+ AbpRabbitMqBackgroundJobOptions.DefaultQueueNamePrefix + JobConfiguration.JobName,
+ AbpRabbitMqBackgroundJobOptions.DefaultDelayedQueueNamePrefix + JobConfiguration.JobName
);
}
@@ -133,6 +135,9 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
var result = QueueConfiguration.Declare(ChannelAccessor.Channel);
Logger.LogDebug($"RabbitMQ Queue '{QueueConfiguration.QueueName}' has {result.MessageCount} messages and {result.ConsumerCount} consumers.");
+ // Declare delayed queue
+ QueueConfiguration.DeclareDelayed(ChannelAccessor.Channel);
+
if (AbpBackgroundJobOptions.IsJobExecutionEnabled)
{
Consumer = new AsyncEventingBasicConsumer(ChannelAccessor.Channel);
@@ -154,12 +159,21 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
BackgroundJobPriority priority = BackgroundJobPriority.Normal,
TimeSpan? delay = null)
{
- //TODO: How to handle priority & delay?
+ //TODO: How to handle priority
+
+ var routingKey = QueueConfiguration.QueueName;
+ var basicProperties = CreateBasicPropertiesToPublish();
+
+ if (delay.HasValue)
+ {
+ routingKey = QueueConfiguration.DelayedQueueName;
+ basicProperties.Expiration = delay.Value.TotalMilliseconds.ToString();
+ }
ChannelAccessor.Channel.BasicPublish(
exchange: "",
- routingKey: QueueConfiguration.QueueName,
- basicProperties: CreateBasicPropertiesToPublish(),
+ routingKey: routingKey,
+ basicProperties: basicProperties,
body: Serializer.Serialize(args)
);
diff --git a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueConfiguration.cs b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueConfiguration.cs
index 959952de22..453c3f9257 100644
--- a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueConfiguration.cs
+++ b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueConfiguration.cs
@@ -1,4 +1,6 @@
using System;
+using System.Collections.Generic;
+using RabbitMQ.Client;
using Volo.Abp.RabbitMQ;
namespace Volo.Abp.BackgroundJobs.RabbitMQ
@@ -9,21 +11,42 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
public string ConnectionName { get; set; }
+ public string DelayedQueueName { get; set; }
+
public JobQueueConfiguration(
- Type jobArgsType,
- string queueName,
+ Type jobArgsType,
+ string queueName,
+ string delayedQueueName,
string connectionName = null,
bool durable = true,
bool exclusive = false,
bool autoDelete = false)
: base(
- queueName,
- durable,
- exclusive,
+ queueName,
+ durable,
+ exclusive,
autoDelete)
{
JobArgsType = jobArgsType;
ConnectionName = connectionName;
+ DelayedQueueName = delayedQueueName;
+ }
+
+ public virtual QueueDeclareOk DeclareDelayed(IModel channel)
+ {
+ var delayedArguments = new Dictionary(Arguments)
+ {
+ ["x-dead-letter-routing-key"] = QueueName,
+ ["x-dead-letter-exchange"] = string.Empty
+ };
+
+ return channel.QueueDeclare(
+ queue: DelayedQueueName,
+ durable: Durable,
+ exclusive: Exclusive,
+ autoDelete: AutoDelete,
+ arguments: delayedArguments
+ );
}
}
-}
\ No newline at end of file
+}
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ProjectNameValidator.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ProjectNameValidator.cs
index 7864b387d0..98de427ee2 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ProjectNameValidator.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ProjectNameValidator.cs
@@ -53,7 +53,7 @@ namespace Volo.Abp.Cli.Utils
{
foreach (var illegalKeyword in IllegalKeywords)
{
- if (projectName.Contains(illegalKeyword))
+ if (projectName.Split(".").Contains(illegalKeyword))
{
throw new CliUsageException("Project name cannot contain the word \"" + illegalKeyword + "\". Specify a different name.");
}
diff --git a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/AbpIdentityClientOptions.cs b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/AbpIdentityClientOptions.cs
index 0e877ee441..e8a8bfcd61 100644
--- a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/AbpIdentityClientOptions.cs
+++ b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/AbpIdentityClientOptions.cs
@@ -1,4 +1,9 @@
-namespace Volo.Abp.IdentityModel
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Volo.Abp.MultiTenancy;
+
+namespace Volo.Abp.IdentityModel
{
public class AbpIdentityClientOptions
{
@@ -8,5 +13,30 @@
{
IdentityClients = new IdentityClientConfigurationDictionary();
}
+
+ public IdentityClientConfiguration GetClientConfiguration(ICurrentTenant currentTenant, string identityClientName = null)
+ {
+ if (identityClientName.IsNullOrWhiteSpace())
+ {
+ identityClientName = IdentityClientConfigurationDictionary.DefaultName;
+ }
+
+ if (currentTenant.Id.HasValue)
+ {
+ var tenantConfiguration = IdentityClients.FirstOrDefault(x => x.Key == $"{identityClientName}.{currentTenant.Id}");
+ if (tenantConfiguration.Key == null && !currentTenant.Name.IsNullOrWhiteSpace())
+ {
+ tenantConfiguration = IdentityClients.FirstOrDefault(x => x.Key == $"{identityClientName}.{currentTenant.Name}");
+ }
+
+ if (tenantConfiguration.Key != null)
+ {
+ return tenantConfiguration.Value;
+ }
+ }
+
+ return IdentityClients.GetOrDefault(identityClientName) ??
+ IdentityClients.Default;
+ }
}
-}
\ No newline at end of file
+}
diff --git a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs
index cc0b470a1e..f3c67c7b95 100644
--- a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs
+++ b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs
@@ -66,7 +66,7 @@ namespace Volo.Abp.IdentityModel
protected virtual async Task GetAccessTokenOrNullAsync(string identityClientName)
{
- var configuration = GetClientConfiguration(identityClientName);
+ var configuration = ClientOptions.GetClientConfiguration(CurrentTenant, identityClientName);
if (configuration == null)
{
Logger.LogWarning($"Could not find {nameof(IdentityClientConfiguration)} for {identityClientName}. Either define a configuration for {identityClientName} or set a default configuration.");
@@ -114,17 +114,6 @@ namespace Volo.Abp.IdentityModel
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
}
- private IdentityClientConfiguration GetClientConfiguration(string identityClientName = null)
- {
- if (identityClientName.IsNullOrEmpty())
- {
- return ClientOptions.IdentityClients.Default;
- }
-
- return ClientOptions.IdentityClients.GetOrDefault(identityClientName) ??
- ClientOptions.IdentityClients.Default;
- }
-
protected virtual async Task GetTokenEndpoint(IdentityClientConfiguration configuration)
{
//TODO: Can use (configuration.Authority + /connect/token) directly?
@@ -205,6 +194,7 @@ namespace Volo.Abp.IdentityModel
UserName = configuration.UserName,
Password = configuration.UserPassword
};
+
IdentityModelHttpRequestMessageOptions.ConfigureHttpRequestMessage?.Invoke(request);
AddParametersToRequestAsync(configuration, request);
diff --git a/framework/test/Volo.Abp.Cli.Core.Tests/Volo/Abp/Cli/ProjectNameValidation_Tests.cs b/framework/test/Volo.Abp.Cli.Core.Tests/Volo/Abp/Cli/ProjectNameValidation_Tests.cs
index 85d9fcc2b7..a1557e68ce 100644
--- a/framework/test/Volo.Abp.Cli.Core.Tests/Volo/Abp/Cli/ProjectNameValidation_Tests.cs
+++ b/framework/test/Volo.Abp.Cli.Core.Tests/Volo/Abp/Cli/ProjectNameValidation_Tests.cs
@@ -51,13 +51,16 @@ namespace Volo.Abp.Cli
{
var illegalKeywords = new[]
{
- "Blazor"
+ "Blazor"
};
foreach (var illegalKeyword in illegalKeywords)
{
var args = new CommandLineArgs("new", illegalKeyword);
await _newCommand.ExecuteAsync(args).ShouldThrowAsync();
+
+ args = new CommandLineArgs("new", "Acme." + illegalKeyword);
+ await _newCommand.ExecuteAsync(args).ShouldThrowAsync();
}
}
diff --git a/framework/test/Volo.Abp.IdentityModel.Tests/Volo.Abp.IdentityModel.Tests.csproj b/framework/test/Volo.Abp.IdentityModel.Tests/Volo.Abp.IdentityModel.Tests.csproj
new file mode 100644
index 0000000000..dd7ba0d439
--- /dev/null
+++ b/framework/test/Volo.Abp.IdentityModel.Tests/Volo.Abp.IdentityModel.Tests.csproj
@@ -0,0 +1,24 @@
+
+
+
+
+
+ net6.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Always
+
+
+
+
diff --git a/framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityClientOptions_Tests.cs b/framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityClientOptions_Tests.cs
new file mode 100644
index 0000000000..1f36ab32f6
--- /dev/null
+++ b/framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityClientOptions_Tests.cs
@@ -0,0 +1,51 @@
+using System;
+using Microsoft.Extensions.Options;
+using Shouldly;
+using Volo.Abp.MultiTenancy;
+using Xunit;
+
+namespace Volo.Abp.IdentityModel
+{
+ public class AbpIdentityClientOptions_Tests : AbpIdentityModelTestBase
+ {
+ private readonly ICurrentTenant _currentTenant;
+ private readonly AbpIdentityClientOptions _identityClientOptions;
+
+ public AbpIdentityClientOptions_Tests()
+ {
+ _currentTenant = GetRequiredService();
+ _identityClientOptions = GetRequiredService>().Value;
+ }
+
+ [Fact]
+ public void GetClientConfiguration_Test()
+ {
+ var hostDefaultConfiguration = _identityClientOptions.GetClientConfiguration(_currentTenant);
+ hostDefaultConfiguration.UserName.ShouldBe("host_default_admin");
+
+ var hostIdentityConfiguration = _identityClientOptions.GetClientConfiguration(_currentTenant, "Identity");
+ hostIdentityConfiguration.UserName.ShouldBe("host_identity_admin");
+
+ using (_currentTenant.Change(Guid.Parse("f72a344f-651e-49f0-85f6-be260a10e4df"), "Test_Tenant1"))
+ {
+ var tenantDefaultConfiguration = _identityClientOptions.GetClientConfiguration(_currentTenant);
+ tenantDefaultConfiguration.UserName.ShouldBe("tenant_default_admin");
+ }
+
+ using (_currentTenant.Change(Guid.Parse("f72a344f-651e-49f0-85f6-be260a10e4df")))
+ {
+ var tenantIdentityConfiguration = _identityClientOptions.GetClientConfiguration(_currentTenant, "Identity");
+ tenantIdentityConfiguration.UserName.ShouldBe("tenant_identity_admin");
+ }
+
+ using (_currentTenant.Change(Guid.NewGuid()))
+ {
+ var configuration = _identityClientOptions.GetClientConfiguration(_currentTenant);
+ configuration.UserName.ShouldBe("host_default_admin");
+
+ configuration = _identityClientOptions.GetClientConfiguration(_currentTenant, "Identity");
+ configuration.UserName.ShouldBe("host_identity_admin");
+ }
+ }
+ }
+}
diff --git a/framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityModelTestBase.cs b/framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityModelTestBase.cs
new file mode 100644
index 0000000000..80ee47ae37
--- /dev/null
+++ b/framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityModelTestBase.cs
@@ -0,0 +1,12 @@
+using Volo.Abp.Testing;
+
+namespace Volo.Abp.IdentityModel
+{
+ public abstract class AbpIdentityModelTestBase : AbpIntegratedTest
+ {
+ protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options)
+ {
+ options.UseAutofac();
+ }
+ }
+}
diff --git a/framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityModelTestModule.cs b/framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityModelTestModule.cs
new file mode 100644
index 0000000000..2a17244e42
--- /dev/null
+++ b/framework/test/Volo.Abp.IdentityModel.Tests/Volo/Abp/IdentityModel/AbpIdentityModelTestModule.cs
@@ -0,0 +1,10 @@
+using Volo.Abp.Modularity;
+
+namespace Volo.Abp.IdentityModel
+{
+ [DependsOn(typeof(AbpIdentityModelModule))]
+ public class AbpIdentityModelTestModule : AbpModule
+ {
+
+ }
+}
diff --git a/framework/test/Volo.Abp.IdentityModel.Tests/appsettings.json b/framework/test/Volo.Abp.IdentityModel.Tests/appsettings.json
new file mode 100644
index 0000000000..f4d01ff407
--- /dev/null
+++ b/framework/test/Volo.Abp.IdentityModel.Tests/appsettings.json
@@ -0,0 +1,40 @@
+{
+ "IdentityClients": {
+ "Default": {
+ "GrantType": "password",
+ "ClientId": "Test_App",
+ "ClientSecret": "1q2w3e*",
+ "UserName": "host_default_admin",
+ "UserPassword": "1q2w3E*",
+ "Authority": "https://localhost:44395",
+ "Scope": "Test_Scope"
+ },
+ "Default.Test_Tenant1": {
+ "GrantType": "password",
+ "ClientId": "Test_App",
+ "ClientSecret": "1q2w3e*",
+ "UserName": "tenant_default_admin",
+ "UserPassword": "1q2w3E*",
+ "Authority": "https://localhost:44395",
+ "Scope": "Test_Scope"
+ },
+ "Identity": {
+ "GrantType": "password",
+ "ClientId": "Test_App",
+ "ClientSecret": "1q2w3e*",
+ "UserName": "host_identity_admin",
+ "UserPassword": "1q2w3E*",
+ "Authority": "https://localhost:44395",
+ "Scope": "Test_Scope"
+ },
+ "Identity.f72a344f-651e-49f0-85f6-be260a10e4df": {
+ "GrantType": "password",
+ "ClientId": "Test_App",
+ "ClientSecret": "1q2w3e*",
+ "UserName": "tenant_identity_admin",
+ "UserPassword": "1q2w3E*",
+ "Authority": "https://localhost:44395",
+ "Scope": "Test_Scope"
+ }
+ }
+}
diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingDbContextModelBuilderExtensions.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingDbContextModelBuilderExtensions.cs
index 51c30ef0a1..37abf469ef 100644
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingDbContextModelBuilderExtensions.cs
+++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingDbContextModelBuilderExtensions.cs
@@ -1,29 +1,19 @@
-using System;
-using JetBrains.Annotations;
+using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
-using Volo.Abp.Identity.EntityFrameworkCore;
namespace Volo.Abp.AuditLogging.EntityFrameworkCore
{
public static class AbpAuditLoggingDbContextModelBuilderExtensions
{
public static void ConfigureAuditLogging(
- [NotNull] this ModelBuilder builder,
- Action optionsAction = null)
+ [NotNull] this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
- var options = new AbpAuditLoggingModelBuilderConfigurationOptions(
- AbpAuditLoggingDbProperties.DbTablePrefix,
- AbpAuditLoggingDbProperties.DbSchema
- );
-
- optionsAction?.Invoke(options);
-
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "AuditLogs", options.Schema);
+ b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogs", AbpAuditLoggingDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -56,7 +46,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "AuditLogActions", options.Schema);
+ b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogActions", AbpAuditLoggingDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -75,7 +65,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "EntityChanges", options.Schema);
+ b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "EntityChanges", AbpAuditLoggingDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -96,7 +86,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "EntityPropertyChanges", options.Schema);
+ b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "EntityPropertyChanges", AbpAuditLoggingDbProperties.DbSchema);
b.ConfigureByConvention();
diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingModelBuilderConfigurationOptions.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingModelBuilderConfigurationOptions.cs
deleted file mode 100644
index 404ce00d0b..0000000000
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingModelBuilderConfigurationOptions.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using JetBrains.Annotations;
-using Volo.Abp.EntityFrameworkCore.Modeling;
-
-namespace Volo.Abp.Identity.EntityFrameworkCore
-{
- public class AbpAuditLoggingModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
- {
- public AbpAuditLoggingModelBuilderConfigurationOptions(
- [NotNull] string tablePrefix,
- [CanBeNull] string schema)
- : base(
- tablePrefix,
- schema)
- {
-
- }
- }
-}
\ No newline at end of file
diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbContextExtensions.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbContextExtensions.cs
index 40411691cb..48b60107ff 100644
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbContextExtensions.cs
+++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbContextExtensions.cs
@@ -1,25 +1,17 @@
-using System;
-using Volo.Abp.MongoDB;
+using Volo.Abp.MongoDB;
namespace Volo.Abp.AuditLogging.MongoDB
{
public static class AbpAuditLoggingMongoDbContextExtensions
{
public static void ConfigureAuditLogging(
- this IMongoModelBuilder builder,
- Action optionsAction = null)
+ this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
- var options = new AuditLoggingMongoModelBuilderConfigurationOptions(
- AbpAuditLoggingDbProperties.DbTablePrefix
- );
-
- optionsAction?.Invoke(options);
-
builder.Entity(b =>
{
- b.CollectionName = options.CollectionPrefix + "AuditLogs";
+ b.CollectionName = AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogs";
});
}
}
diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AuditLoggingMongoModelBuilderConfigurationOptions.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AuditLoggingMongoModelBuilderConfigurationOptions.cs
deleted file mode 100644
index 553ba4d01c..0000000000
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AuditLoggingMongoModelBuilderConfigurationOptions.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using JetBrains.Annotations;
-using Volo.Abp.MongoDB;
-
-namespace Volo.Abp.AuditLogging.MongoDB
-{
- public class AuditLoggingMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
- {
- public AuditLoggingMongoModelBuilderConfigurationOptions(
- [NotNull] string collectionPrefix = "")
- : base(collectionPrefix)
- {
- }
- }
-}
diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs
index 76d39a77ae..1781c7067d 100644
--- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs
+++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs
@@ -7,8 +7,7 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
public static class BackgroundJobsDbContextModelCreatingExtensions
{
public static void ConfigureBackgroundJobs(
- this ModelBuilder builder,
- Action optionsAction = null)
+ this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
@@ -17,16 +16,9 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
return;
}
- var options = new BackgroundJobsModelBuilderConfigurationOptions(
- BackgroundJobsDbProperties.DbTablePrefix,
- BackgroundJobsDbProperties.DbSchema
- );
-
- optionsAction?.Invoke(options);
-
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "BackgroundJobs", options.Schema);
+ b.ToTable(BackgroundJobsDbProperties.DbTablePrefix + "BackgroundJobs", BackgroundJobsDbProperties.DbSchema);
b.ConfigureByConvention();
diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsModelBuilderConfigurationOptions.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsModelBuilderConfigurationOptions.cs
deleted file mode 100644
index 47734aa3a3..0000000000
--- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsModelBuilderConfigurationOptions.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using JetBrains.Annotations;
-using Volo.Abp.EntityFrameworkCore.Modeling;
-
-namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
-{
- public class BackgroundJobsModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
- {
- public BackgroundJobsModelBuilderConfigurationOptions(
- [NotNull] string tablePrefix = "",
- [CanBeNull] string schema = null)
- : base(
- tablePrefix,
- schema)
- {
-
- }
- }
-}
\ No newline at end of file
diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs
index 31291f2d9b..410218e5e6 100644
--- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs
+++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs
@@ -1,26 +1,18 @@
-using System;
-using Volo.Abp.MongoDB;
+using Volo.Abp.MongoDB;
namespace Volo.Abp.BackgroundJobs.MongoDB
{
public static class BackgroundJobsMongoDbContextExtensions
{
public static void ConfigureBackgroundJobs(
- this IMongoModelBuilder builder,
- Action optionsAction = null)
+ this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
- var options = new BackgroundJobsMongoModelBuilderConfigurationOptions(
- BackgroundJobsDbProperties.DbTablePrefix
- );
-
- optionsAction?.Invoke(options);
-
builder.Entity(b =>
{
- b.CollectionName = options.CollectionPrefix + "BackgroundJobs";
+ b.CollectionName = BackgroundJobsDbProperties.DbTablePrefix + "BackgroundJobs";
});
}
}
-}
\ No newline at end of file
+}
diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoModelBuilderConfigurationOptions.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoModelBuilderConfigurationOptions.cs
deleted file mode 100644
index 7590fb0d12..0000000000
--- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoModelBuilderConfigurationOptions.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using JetBrains.Annotations;
-using Volo.Abp.MongoDB;
-
-namespace Volo.Abp.BackgroundJobs.MongoDB
-{
- public class BackgroundJobsMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
- {
- public BackgroundJobsMongoModelBuilderConfigurationOptions(
- [NotNull] string collectionPrefix = "")
- : base(collectionPrefix)
- {
- }
- }
-}
\ No newline at end of file
diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs
index ddcaae7911..fe0e289fb1 100644
--- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs
+++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs
@@ -1,5 +1,4 @@
using Microsoft.EntityFrameworkCore;
-using System;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore
@@ -7,21 +6,13 @@ namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore
public static class BlobStoringDbContextModelCreatingExtensions
{
public static void ConfigureBlobStoring(
- this ModelBuilder builder,
- Action optionsAction = null)
+ this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
- var options = new BlobStoringModelBuilderConfigurationOptions(
- BlobStoringDatabaseDbProperties.DbTablePrefix,
- BlobStoringDatabaseDbProperties.DbSchema
- );
-
- optionsAction?.Invoke(options);
-
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "BlobContainers", options.Schema);
+ b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers", BlobStoringDatabaseDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -36,7 +27,7 @@ namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "Blobs", options.Schema);
+ b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs", BlobStoringDatabaseDbProperties.DbSchema);
b.ConfigureByConvention();
diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringModelBuilderConfigurationOptions.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringModelBuilderConfigurationOptions.cs
deleted file mode 100644
index fce10576be..0000000000
--- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringModelBuilderConfigurationOptions.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using JetBrains.Annotations;
-using Volo.Abp.EntityFrameworkCore.Modeling;
-
-namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore
-{
- public class BlobStoringModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
- {
- public BlobStoringModelBuilderConfigurationOptions(
- [NotNull] string tablePrefix = "",
- [CanBeNull] string schema = null)
- : base(
- tablePrefix,
- schema)
- {
-
- }
- }
-}
\ No newline at end of file
diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs
index f96f991bc9..cc5b6720b7 100644
--- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs
+++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs
@@ -1,31 +1,23 @@
-using System;
-using Volo.Abp.MongoDB;
+using Volo.Abp.MongoDB;
namespace Volo.Abp.BlobStoring.Database.MongoDB
{
public static class BlobStoringMongoDbContextExtensions
{
public static void ConfigureBlobStoring(
- this IMongoModelBuilder builder,
- Action optionsAction = null)
+ this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
- var options = new BlobStoringMongoModelBuilderConfigurationOptions(
- BlobStoringDatabaseDbProperties.DbTablePrefix
- );
-
- optionsAction?.Invoke(options);
-
builder.Entity(b =>
{
- b.CollectionName = options.CollectionPrefix + "BlobContainers";
+ b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers";
});
builder.Entity(b =>
{
- b.CollectionName = options.CollectionPrefix + "Blobs";
+ b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs";
});
}
}
-}
\ No newline at end of file
+}
diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoModelBuilderConfigurationOptions.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoModelBuilderConfigurationOptions.cs
deleted file mode 100644
index f0f786e1dd..0000000000
--- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoModelBuilderConfigurationOptions.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using JetBrains.Annotations;
-using Volo.Abp.MongoDB;
-
-namespace Volo.Abp.BlobStoring.Database.MongoDB
-{
- public class BlobStoringMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
- {
- public BlobStoringMongoModelBuilderConfigurationOptions(
- [NotNull] string collectionPrefix = "")
- : base(collectionPrefix)
- {
- }
- }
-}
\ No newline at end of file
diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs
index 4a0d23a0fb..3386da25a5 100644
--- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs
+++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs
@@ -1,5 +1,4 @@
-using System;
-using JetBrains.Annotations;
+using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
@@ -15,8 +14,7 @@ namespace Volo.Blogging.EntityFrameworkCore
public static class BloggingDbContextModelBuilderExtensions
{
public static void ConfigureBlogging(
- [NotNull] this ModelBuilder builder,
- Action optionsAction = null)
+ [NotNull] this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
@@ -25,16 +23,9 @@ namespace Volo.Blogging.EntityFrameworkCore
return;
}
- var options = new BloggingModelBuilderConfigurationOptions(
- BloggingDbProperties.DbTablePrefix,
- BloggingDbProperties.DbSchema
- );
-
- optionsAction?.Invoke(options);
-
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "Users", options.Schema);
+ b.ToTable(BloggingDbProperties.DbTablePrefix + "Users", BloggingDbProperties.DbSchema);
b.ConfigureByConvention();
b.ConfigureAbpUser();
@@ -44,7 +35,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "Blogs", options.Schema);
+ b.ToTable(BloggingDbProperties.DbTablePrefix + "Blogs", BloggingDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -57,7 +48,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "Posts", options.Schema);
+ b.ToTable(BloggingDbProperties.DbTablePrefix + "Posts", BloggingDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -77,7 +68,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "Comments", options.Schema);
+ b.ToTable(BloggingDbProperties.DbTablePrefix + "Comments", BloggingDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -93,7 +84,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "Tags", options.Schema);
+ b.ToTable(BloggingDbProperties.DbTablePrefix + "Tags", BloggingDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -108,7 +99,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "PostTags", options.Schema);
+ b.ToTable(BloggingDbProperties.DbTablePrefix + "PostTags", BloggingDbProperties.DbSchema);
b.ConfigureByConvention();
diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingModelBuilderConfigurationOptions.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingModelBuilderConfigurationOptions.cs
deleted file mode 100644
index af888ab402..0000000000
--- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingModelBuilderConfigurationOptions.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using JetBrains.Annotations;
-using Volo.Abp.EntityFrameworkCore.Modeling;
-
-namespace Volo.Blogging.EntityFrameworkCore
-{
- public class BloggingModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
- {
- public BloggingModelBuilderConfigurationOptions(
- [NotNull] string tablePrefix = "",
- [CanBeNull] string schema = null)
- : base(tablePrefix, schema)
- {
- }
- }
-}
\ No newline at end of file
diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs
index 3defbc1287..b04f0a74fc 100644
--- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs
+++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs
@@ -1,5 +1,4 @@
-using System;
-using Volo.Abp;
+using Volo.Abp;
using Volo.Abp.MongoDB;
using Volo.Blogging.Blogs;
using Volo.Blogging.Comments;
@@ -11,40 +10,33 @@ namespace Volo.Blogging.MongoDB
public static class BloggingMongoDbContextExtensions
{
public static void ConfigureBlogging(
- this IMongoModelBuilder builder,
- Action optionsAction = null)
+ this IMongoModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
- var options = new BloggingMongoModelBuilderConfigurationOptions(
- BloggingDbProperties.DbTablePrefix
- );
-
- optionsAction?.Invoke(options);
-
builder.Entity(b =>
{
- b.CollectionName = options.CollectionPrefix + "Users";
+ b.CollectionName = BloggingDbProperties.DbTablePrefix + "Users";
});
builder.Entity(b =>
{
- b.CollectionName = options.CollectionPrefix + "Blogs";
+ b.CollectionName = BloggingDbProperties.DbTablePrefix + "Blogs";
});
builder.Entity(b =>
{
- b.CollectionName = options.CollectionPrefix + "Posts";
+ b.CollectionName = BloggingDbProperties.DbTablePrefix + "Posts";
});
builder.Entity(b =>
{
- b.CollectionName = options.CollectionPrefix + "Tags";
+ b.CollectionName = BloggingDbProperties.DbTablePrefix + "Tags";
});
builder.Entity(b =>
{
- b.CollectionName = options.CollectionPrefix + "Comments";
+ b.CollectionName = BloggingDbProperties.DbTablePrefix + "Comments";
});
}
}
diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoModelBuilderConfigurationOptions.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoModelBuilderConfigurationOptions.cs
deleted file mode 100644
index d2fb415166..0000000000
--- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoModelBuilderConfigurationOptions.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using JetBrains.Annotations;
-using Volo.Abp.MongoDB;
-
-namespace Volo.Blogging.MongoDB
-{
- public class BloggingMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
- {
- public BloggingMongoModelBuilderConfigurationOptions(
- [NotNull] string collectionPrefix = "")
- : base(collectionPrefix)
- {
- }
- }
-}
diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs
index f7964c1711..14a242a9de 100644
--- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs
+++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs
@@ -1,5 +1,4 @@
using Microsoft.EntityFrameworkCore;
-using System;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Volo.Abp.GlobalFeatures;
@@ -20,23 +19,15 @@ namespace Volo.CmsKit.EntityFrameworkCore
public static class CmsKitDbContextModelCreatingExtensions
{
public static void ConfigureCmsKit(
- this ModelBuilder builder,
- Action optionsAction = null)
+ this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
- var options = new CmsKitModelBuilderConfigurationOptions(
- CmsKitDbProperties.DbTablePrefix,
- CmsKitDbProperties.DbSchema
- );
-
- optionsAction?.Invoke(options);
-
if (GlobalFeatureManager.Instance.IsEnabled())
{
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "Users", options.Schema);
+ b.ToTable(CmsKitDbProperties.DbTablePrefix + "Users", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
b.ConfigureAbpUser();
@@ -56,7 +47,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "UserReactions", options.Schema);
+ b.ToTable(CmsKitDbProperties.DbTablePrefix + "UserReactions", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -79,7 +70,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "Comments", options.Schema);
+ b.ToTable(CmsKitDbProperties.DbTablePrefix + "Comments", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -103,7 +94,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity(r =>
{
- r.ToTable(options.TablePrefix + "Ratings", options.Schema);
+ r.ToTable(CmsKitDbProperties.DbTablePrefix + "Ratings", CmsKitDbProperties.DbSchema);
r.ConfigureByConvention();
@@ -125,7 +116,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "Tags", options.Schema);
+ b.ToTable(CmsKitDbProperties.DbTablePrefix + "Tags", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -143,7 +134,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "EntityTags", options.Schema);
+ b.ToTable(CmsKitDbProperties.DbTablePrefix + "EntityTags", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -167,7 +158,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "Pages", options.Schema);
+ b.ToTable(CmsKitDbProperties.DbTablePrefix + "Pages", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -189,7 +180,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "Blogs", options.Schema);
+ b.ToTable(CmsKitDbProperties.DbTablePrefix + "Blogs", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -202,7 +193,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "BlogPosts", options.Schema);
+ b.ToTable(CmsKitDbProperties.DbTablePrefix + "BlogPosts", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -219,7 +210,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "BlogFeatures", options.Schema);
+ b.ToTable(CmsKitDbProperties.DbTablePrefix + "BlogFeatures", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -239,7 +230,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity(b =>
{
- b.ToTable(options.TablePrefix + "MediaDescriptors", options.Schema);
+ b.ToTable(CmsKitDbProperties.DbTablePrefix + "MediaDescriptors", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention();
@@ -260,7 +251,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{
builder.Entity