Browse Source

Merge branch 'dev' into feat/10060-proxy

pull/10086/head
Mehmet Erim 5 years ago
committed by GitHub
parent
commit
f8dcf372dd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      docs/en/Background-Jobs-Hangfire.md
  2. 6
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpRabbitMqBackgroundJobOptions.cs
  3. 22
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs
  4. 35
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueConfiguration.cs
  5. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ProjectNameValidator.cs
  6. 2
      framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo.Abp.EntityFrameworkCore.Oracle.csproj
  7. 3
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientModule.cs
  8. 2
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ApiVersionInfo.cs
  9. 269
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyBase.cs
  10. 6
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyRequestContext.cs
  11. 13
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyRequestPayloadBuilder.cs
  12. 17
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyUrlBuilder.cs
  13. 63
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs
  14. 19
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptorClientProxy.cs
  15. 267
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/Proxying/HttpProxyExecuter.cs
  16. 12
      framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/Proxying/IHttpProxyExecuter.cs
  17. 5
      framework/test/Volo.Abp.Cli.Core.Tests/Volo/Abp/Cli/ProjectNameValidation_Tests.cs
  18. 1
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Password/AccountProfilePasswordManagementGroupViewComponent.cs
  19. 1
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/AccountProfilePersonalInfoManagementGroupViewComponent.cs
  20. 22
      modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingDbContextModelBuilderExtensions.cs
  21. 18
      modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingModelBuilderConfigurationOptions.cs
  22. 14
      modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbContextExtensions.cs
  23. 14
      modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AuditLoggingMongoModelBuilderConfigurationOptions.cs
  24. 12
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs
  25. 18
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsModelBuilderConfigurationOptions.cs
  26. 16
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs
  27. 14
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoModelBuilderConfigurationOptions.cs
  28. 15
      modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs
  29. 18
      modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringModelBuilderConfigurationOptions.cs
  30. 18
      modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs
  31. 14
      modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoModelBuilderConfigurationOptions.cs
  32. 5
      modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs
  33. 12
      modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj
  34. 25
      modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs
  35. 15
      modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingModelBuilderConfigurationOptions.cs
  36. 22
      modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs
  37. 14
      modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoModelBuilderConfigurationOptions.cs
  38. 1
      modules/cms-kit/host/Volo.CmsKit.IdentityServer/CmsKitIdentityServerModule.cs
  39. 1
      modules/cms-kit/host/Volo.CmsKit.IdentityServer/Volo.CmsKit.IdentityServer.csproj
  40. 3123
      modules/cms-kit/host/Volo.CmsKit.IdentityServer/wwwroot/libs/sweetalert2/sweetalert2.all.js
  41. 2
      modules/cms-kit/host/Volo.CmsKit.IdentityServer/wwwroot/libs/sweetalert2/sweetalert2.all.min.js
  42. 1319
      modules/cms-kit/host/Volo.CmsKit.IdentityServer/wwwroot/libs/sweetalert2/sweetalert2.css
  43. 3121
      modules/cms-kit/host/Volo.CmsKit.IdentityServer/wwwroot/libs/sweetalert2/sweetalert2.js
  44. 1
      modules/cms-kit/host/Volo.CmsKit.IdentityServer/wwwroot/libs/sweetalert2/sweetalert2.min.css
  45. 1
      modules/cms-kit/host/Volo.CmsKit.IdentityServer/wwwroot/libs/sweetalert2/sweetalert2.min.js
  46. 3123
      modules/cms-kit/host/Volo.CmsKit.Web.Host/wwwroot/libs/sweetalert2/sweetalert2.all.js
  47. 2
      modules/cms-kit/host/Volo.CmsKit.Web.Host/wwwroot/libs/sweetalert2/sweetalert2.all.min.js
  48. 1319
      modules/cms-kit/host/Volo.CmsKit.Web.Host/wwwroot/libs/sweetalert2/sweetalert2.css
  49. 3121
      modules/cms-kit/host/Volo.CmsKit.Web.Host/wwwroot/libs/sweetalert2/sweetalert2.js
  50. 1
      modules/cms-kit/host/Volo.CmsKit.Web.Host/wwwroot/libs/sweetalert2/sweetalert2.min.css
  51. 1
      modules/cms-kit/host/Volo.CmsKit.Web.Host/wwwroot/libs/sweetalert2/sweetalert2.min.js
  52. 11
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/CmsKitWebUnifiedModule.cs
  53. 6
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/Volo.CmsKit.Web.Unified.csproj
  54. 3123
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/sweetalert2/sweetalert2.all.js
  55. 2
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/sweetalert2/sweetalert2.all.min.js
  56. 1319
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/sweetalert2/sweetalert2.css
  57. 3121
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/sweetalert2/sweetalert2.js
  58. 1
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/sweetalert2/sweetalert2.min.css
  59. 1
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/sweetalert2/sweetalert2.min.js
  60. 3
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Menus/MenuItemAdminAppService.cs
  61. 12
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Menus/MenuItem.cs
  62. 35
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs
  63. 18
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitModelBuilderConfigurationOptions.cs
  64. 12
      modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs
  65. 14
      modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoModelBuilderConfigurationOptions.cs
  66. 5
      modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj
  67. 10
      modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs
  68. 3123
      modules/docs/app/VoloDocs.Web/wwwroot/libs/sweetalert2/sweetalert2.all.js
  69. 2
      modules/docs/app/VoloDocs.Web/wwwroot/libs/sweetalert2/sweetalert2.all.min.js
  70. 1319
      modules/docs/app/VoloDocs.Web/wwwroot/libs/sweetalert2/sweetalert2.css
  71. 3121
      modules/docs/app/VoloDocs.Web/wwwroot/libs/sweetalert2/sweetalert2.js
  72. 1
      modules/docs/app/VoloDocs.Web/wwwroot/libs/sweetalert2/sweetalert2.min.css
  73. 1
      modules/docs/app/VoloDocs.Web/wwwroot/libs/sweetalert2/sweetalert2.min.js
  74. 19
      modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs
  75. 15
      modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsModelBuilderConfigurationOptions.cs
  76. 16
      modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContextExtensions.cs
  77. 14
      modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoModelBuilderConfigurationOptions.cs
  78. 12
      modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContextModelCreatingExtensions.cs
  79. 18
      modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementModelBuilderConfigurationOptions.cs
  80. 14
      modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContextExtensions.cs
  81. 15
      modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoModelBuilderConfigurationOptions.cs
  82. 4
      modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/ProfileAppService.cs
  83. 83
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs
  84. 23
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerModelBuilderConfigurationOptions.cs
  85. 24
      modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/AbpIdentityServerMongoDbContextExtensions.cs
  86. 13
      modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/IdentityServerMongoModelBuilderConfigurationOptions.cs
  87. 15
      modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementDbContextModelBuilderExtensions.cs
  88. 18
      modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementModelBuilderConfigurationOptions.cs
  89. 14
      modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbContextExtensions.cs
  90. 14
      modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/PermissionManagementMongoModelBuilderConfigurationOptions.cs
  91. 2
      modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml
  92. 5
      modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/DemoAppModule.cs
  93. 4
      modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/Volo.Abp.SettingManagement.DemoApp.csproj
  94. 3123
      modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/wwwroot/libs/sweetalert2/sweetalert2.all.js
  95. 2
      modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/wwwroot/libs/sweetalert2/sweetalert2.all.min.js
  96. 1319
      modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/wwwroot/libs/sweetalert2/sweetalert2.css
  97. 3121
      modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/wwwroot/libs/sweetalert2/sweetalert2.js
  98. 1
      modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/wwwroot/libs/sweetalert2/sweetalert2.min.css
  99. 1
      modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/wwwroot/libs/sweetalert2/sweetalert2.min.js
  100. 28
      modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContextModelBuilderExtensions.cs

22
docs/en/Background-Jobs-Hangfire.md

@ -88,17 +88,21 @@ To make it secure by default, only local requests are allowed, however you can c
You can integrate the Hangfire dashboard to [ABP authorization system](Authorization.md) using the **AbpHangfireAuthorizationFilter** You can integrate the Hangfire dashboard to [ABP authorization system](Authorization.md) using the **AbpHangfireAuthorizationFilter**
class. This class is defined in the `Volo.Abp.Hangfire` package. The following example, checks if the current user is logged in to the application: class. This class is defined in the `Volo.Abp.Hangfire` package. The following example, checks if the current user is logged in to the application:
app.UseHangfireDashboard("/hangfire", new DashboardOptions ```csharp
{ app.UseHangfireDashboard("/hangfire", new DashboardOptions
AsyncAuthorization = new[] { new AbpHangfireAuthorizationFilter() } {
}); AsyncAuthorization = new[] { new AbpHangfireAuthorizationFilter() }
});
```
If you want to require an additional permission, you can pass it into the constructor as below: If you want to require an additional permission, you can pass it into the constructor as below:
app.UseHangfireDashboard("/hangfire", new DashboardOptions ```csharp
{ app.UseHangfireDashboard("/hangfire", new DashboardOptions
AsyncAuthorization = new[] { new AbpHangfireAuthorizationFilter("MyHangFireDashboardPermissionName") } {
}); AsyncAuthorization = new[] { new AbpHangfireAuthorizationFilter("MyHangFireDashboardPermissionName") }
});
```
**Important**: `UseHangfireDashboard` should be called after the authentication middleware in your `Startup` class (probably at the last line). Otherwise, **Important**: `UseHangfireDashboard` should be called after the authentication and authorization middlewares in your `Startup` class (probably at the last line). Otherwise,
authorization will always fail! authorization will always fail!

6
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpRabbitMqBackgroundJobOptions.cs

@ -15,10 +15,16 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
/// </summary> /// </summary>
public string DefaultQueueNamePrefix { get; set; } public string DefaultQueueNamePrefix { get; set; }
/// <summary>
/// Default value: "AbpBackgroundJobsDelayed."
/// </summary>
public string DefaultDelayedQueueNamePrefix { get; set;}
public AbpRabbitMqBackgroundJobOptions() public AbpRabbitMqBackgroundJobOptions()
{ {
JobQueues = new Dictionary<Type, JobQueueConfiguration>(); JobQueues = new Dictionary<Type, JobQueueConfiguration>();
DefaultQueueNamePrefix = "AbpBackgroundJobs."; DefaultQueueNamePrefix = "AbpBackgroundJobs.";
DefaultDelayedQueueNamePrefix = "AbpBackgroundJobsDelayed.";
} }
} }
} }

22
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -64,7 +65,8 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
return AbpRabbitMqBackgroundJobOptions.JobQueues.GetOrDefault(typeof(TArgs)) ?? return AbpRabbitMqBackgroundJobOptions.JobQueues.GetOrDefault(typeof(TArgs)) ??
new JobQueueConfiguration( new JobQueueConfiguration(
typeof(TArgs), 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); var result = QueueConfiguration.Declare(ChannelAccessor.Channel);
Logger.LogDebug($"RabbitMQ Queue '{QueueConfiguration.QueueName}' has {result.MessageCount} messages and {result.ConsumerCount} consumers."); Logger.LogDebug($"RabbitMQ Queue '{QueueConfiguration.QueueName}' has {result.MessageCount} messages and {result.ConsumerCount} consumers.");
// Declare delayed queue
QueueConfiguration.DeclareDelayed(ChannelAccessor.Channel);
if (AbpBackgroundJobOptions.IsJobExecutionEnabled) if (AbpBackgroundJobOptions.IsJobExecutionEnabled)
{ {
Consumer = new AsyncEventingBasicConsumer(ChannelAccessor.Channel); Consumer = new AsyncEventingBasicConsumer(ChannelAccessor.Channel);
@ -154,12 +159,21 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
BackgroundJobPriority priority = BackgroundJobPriority.Normal, BackgroundJobPriority priority = BackgroundJobPriority.Normal,
TimeSpan? delay = null) 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( ChannelAccessor.Channel.BasicPublish(
exchange: "", exchange: "",
routingKey: QueueConfiguration.QueueName, routingKey: routingKey,
basicProperties: CreateBasicPropertiesToPublish(), basicProperties: basicProperties,
body: Serializer.Serialize(args) body: Serializer.Serialize(args)
); );

35
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueConfiguration.cs

@ -1,4 +1,6 @@
using System; using System;
using System.Collections.Generic;
using RabbitMQ.Client;
using Volo.Abp.RabbitMQ; using Volo.Abp.RabbitMQ;
namespace Volo.Abp.BackgroundJobs.RabbitMQ namespace Volo.Abp.BackgroundJobs.RabbitMQ
@ -9,21 +11,42 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
public string ConnectionName { get; set; } public string ConnectionName { get; set; }
public string DelayedQueueName { get; set; }
public JobQueueConfiguration( public JobQueueConfiguration(
Type jobArgsType, Type jobArgsType,
string queueName, string queueName,
string delayedQueueName,
string connectionName = null, string connectionName = null,
bool durable = true, bool durable = true,
bool exclusive = false, bool exclusive = false,
bool autoDelete = false) bool autoDelete = false)
: base( : base(
queueName, queueName,
durable, durable,
exclusive, exclusive,
autoDelete) autoDelete)
{ {
JobArgsType = jobArgsType; JobArgsType = jobArgsType;
ConnectionName = connectionName; ConnectionName = connectionName;
DelayedQueueName = delayedQueueName;
}
public virtual QueueDeclareOk DeclareDelayed(IModel channel)
{
var delayedArguments = new Dictionary<string, object>(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
);
} }
} }
} }

2
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) 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."); throw new CliUsageException("Project name cannot contain the word \"" + illegalKeyword + "\". Specify a different name.");
} }

2
framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo.Abp.EntityFrameworkCore.Oracle.csproj

@ -18,7 +18,7 @@
<ProjectReference Include="..\Volo.Abp.EntityFrameworkCore\Volo.Abp.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\Volo.Abp.EntityFrameworkCore\Volo.Abp.EntityFrameworkCore.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Oracle.EntityFrameworkCore" Version="5.21.1" /> <PackageReference Include="Oracle.EntityFrameworkCore" Version="5.21.1" />
</ItemGroup> </ItemGroup>

3
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientModule.cs

@ -5,6 +5,7 @@ using Volo.Abp.MultiTenancy;
using Volo.Abp.Threading; using Volo.Abp.Threading;
using Volo.Abp.Validation; using Volo.Abp.Validation;
using Volo.Abp.ExceptionHandling; using Volo.Abp.ExceptionHandling;
using Volo.Abp.Http.Client.DynamicProxying;
namespace Volo.Abp.Http.Client namespace Volo.Abp.Http.Client
{ {
@ -22,6 +23,8 @@ namespace Volo.Abp.Http.Client
{ {
var configuration = context.Services.GetConfiguration(); var configuration = context.Services.GetConfiguration();
Configure<AbpRemoteServiceOptions>(configuration); Configure<AbpRemoteServiceOptions>(configuration);
context.Services.AddTransient(typeof(DynamicHttpProxyInterceptorClientProxy<>));
} }
} }
} }

2
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/Proxying/ApiVersionInfo.cs → framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ApiVersionInfo.cs

@ -1,6 +1,6 @@
using System; using System;
namespace Volo.Abp.Http.Client.Proxying namespace Volo.Abp.Http.Client.ClientProxying
{ {
public class ApiVersionInfo //TODO: Rename to not conflict with api versioning apis public class ApiVersionInfo //TODO: Rename to not conflict with api versioning apis
{ {

269
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyBase.cs

@ -1,9 +1,23 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq; using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Primitives;
using Volo.Abp.Content;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client.Authentication;
using Volo.Abp.Http.Client.Proxying; using Volo.Abp.Http.Client.Proxying;
using Volo.Abp.Http.Modeling; using Volo.Abp.Http.Modeling;
using Volo.Abp.Http.ProxyScripting.Generators;
using Volo.Abp.Json;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Threading;
using Volo.Abp.Tracing;
namespace Volo.Abp.Http.Client.ClientProxying namespace Volo.Abp.Http.Client.ClientProxying
{ {
@ -11,42 +25,265 @@ namespace Volo.Abp.Http.Client.ClientProxying
{ {
public IAbpLazyServiceProvider LazyServiceProvider { get; set; } public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
protected IHttpProxyExecuter HttpProxyExecuter => LazyServiceProvider.LazyGetRequiredService<IHttpProxyExecuter>();
protected IClientProxyApiDescriptionFinder ClientProxyApiDescriptionFinder => LazyServiceProvider.LazyGetRequiredService<IClientProxyApiDescriptionFinder>(); protected IClientProxyApiDescriptionFinder ClientProxyApiDescriptionFinder => LazyServiceProvider.LazyGetRequiredService<IClientProxyApiDescriptionFinder>();
protected ICancellationTokenProvider CancellationTokenProvider => LazyServiceProvider.LazyGetRequiredService<ICancellationTokenProvider>();
protected ICorrelationIdProvider CorrelationIdProvider => LazyServiceProvider.LazyGetRequiredService<ICorrelationIdProvider>();
protected ICurrentTenant CurrentTenant => LazyServiceProvider.LazyGetRequiredService<ICurrentTenant>();
protected IOptions<AbpCorrelationIdOptions> AbpCorrelationIdOptions => LazyServiceProvider.LazyGetRequiredService<IOptions<AbpCorrelationIdOptions>>();
protected IProxyHttpClientFactory HttpClientFactory => LazyServiceProvider.LazyGetRequiredService<IProxyHttpClientFactory>();
protected IRemoteServiceConfigurationProvider RemoteServiceConfigurationProvider => LazyServiceProvider.LazyGetRequiredService<IRemoteServiceConfigurationProvider>();
protected IOptions<AbpHttpClientOptions> ClientOptions => LazyServiceProvider.LazyGetRequiredService<IOptions<AbpHttpClientOptions>>();
protected IJsonSerializer JsonSerializer => LazyServiceProvider.LazyGetRequiredService<IJsonSerializer>();
protected IRemoteServiceHttpClientAuthenticator ClientAuthenticator => LazyServiceProvider.LazyGetRequiredService<IRemoteServiceHttpClientAuthenticator>();
protected ClientProxyRequestPayloadBuilder ClientProxyRequestPayloadBuilder => LazyServiceProvider.LazyGetRequiredService<ClientProxyRequestPayloadBuilder>();
protected ClientProxyUrlBuilder ClientProxyUrlBuilder => LazyServiceProvider.LazyGetRequiredService<ClientProxyUrlBuilder>();
protected virtual async Task RequestAsync(string methodName, params object[] arguments) protected virtual async Task RequestAsync(string methodName, params object[] arguments)
{ {
await HttpProxyExecuter.MakeRequestAsync(BuildHttpProxyExecuterContext(methodName, arguments)); await RequestAsync(BuildHttpProxyClientProxyContext(methodName, arguments));
} }
protected virtual async Task<T> RequestAsync<T>(string methodName, params object[] arguments) protected virtual async Task<T> RequestAsync<T>(string methodName, params object[] arguments)
{ {
return await HttpProxyExecuter.MakeRequestAndGetResultAsync<T>(BuildHttpProxyExecuterContext(methodName, arguments)); return await RequestAsync<T>(BuildHttpProxyClientProxyContext(methodName, arguments));
} }
protected virtual HttpProxyExecuterContext BuildHttpProxyExecuterContext(string methodName, params object[] arguments) protected virtual ClientProxyRequestContext BuildHttpProxyClientProxyContext(string methodName, params object[] arguments)
{ {
var actionKey = GetActionKey(methodName, arguments); var methodUniqueName = $"{typeof(TService).FullName}.{methodName}.{string.Join("-", arguments.Select(x => x.GetType().FullName))}";
var action = ClientProxyApiDescriptionFinder.FindAction(actionKey); var action = ClientProxyApiDescriptionFinder.FindAction(methodUniqueName);
return new HttpProxyExecuterContext(action, BuildArguments(action, arguments), typeof(TService)); if (action == null)
{
throw new AbpException($"The API description of the {typeof(TService).FullName}.{methodName} method was not found!");
}
return new ClientProxyRequestContext(
action,
action.Parameters
.GroupBy(x => x.NameOnMethod)
.Select((x, i) => new KeyValuePair<string, object>(x.Key, arguments[i]))
.ToDictionary(x => x.Key, x => x.Value),
typeof(TService));
} }
protected virtual Dictionary<string, object> BuildArguments(ActionApiDescriptionModel action, object[] arguments) protected virtual async Task<T> RequestAsync<T>(ClientProxyRequestContext requestContext)
{ {
var parameters = action.Parameters.GroupBy(x => x.NameOnMethod).Select(x => x.Key).ToList(); var responseContent = await RequestAsync(requestContext);
var dict = new Dictionary<string, object>();
if (typeof(T) == typeof(IRemoteStreamContent) ||
typeof(T) == typeof(RemoteStreamContent))
{
/* returning a class that holds a reference to response
* content just to be sure that GC does not dispose of
* it before we finish doing our work with the stream */
return (T)(object)new RemoteStreamContent(
await responseContent.ReadAsStreamAsync(),
responseContent.Headers?.ContentDisposition?.FileNameStar ??
RemoveQuotes(responseContent.Headers?.ContentDisposition?.FileName).ToString(),
responseContent.Headers?.ContentType?.ToString(),
responseContent.Headers?.ContentLength);
}
var stringContent = await responseContent.ReadAsStringAsync();
if (typeof(T) == typeof(string))
{
return (T)(object)stringContent;
}
if (stringContent.IsNullOrWhiteSpace())
{
return default;
}
return JsonSerializer.Deserialize<T>(stringContent);
}
protected virtual async Task<HttpContent> RequestAsync(ClientProxyRequestContext requestContext)
{
var clientConfig = ClientOptions.Value.HttpClientProxies.GetOrDefault(requestContext.ServiceType) ?? throw new AbpException($"Could not get HttpClientProxyConfig for {requestContext.ServiceType.FullName}.");
var remoteServiceConfig = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(clientConfig.RemoteServiceName);
var client = HttpClientFactory.Create(clientConfig.RemoteServiceName);
var apiVersion = await GetApiVersionInfoAsync(requestContext);
var url = remoteServiceConfig.BaseUrl.EnsureEndsWith('/') + await GetUrlWithParametersAsync(requestContext, apiVersion);
var requestMessage = new HttpRequestMessage(requestContext.Action.GetHttpMethod(), url)
{
Content = ClientProxyRequestPayloadBuilder.BuildContent(requestContext.Action, requestContext.Arguments, JsonSerializer, apiVersion)
};
AddHeaders(requestContext.Arguments, requestContext.Action, requestMessage, apiVersion);
if (requestContext.Action.AllowAnonymous != true)
{
await ClientAuthenticator.Authenticate(
new RemoteServiceHttpClientAuthenticateContext(
client,
requestMessage,
remoteServiceConfig,
clientConfig.RemoteServiceName
)
);
}
var response = await client.SendAsync(
requestMessage,
HttpCompletionOption.ResponseHeadersRead /*this will buffer only the headers, the content will be used as a stream*/,
GetCancellationToken(requestContext.Arguments)
);
for (var i = 0; i < parameters.Count; i++) if (!response.IsSuccessStatusCode)
{ {
dict[parameters[i]] = arguments[i]; await ThrowExceptionForResponseAsync(response);
} }
return dict; return response.Content;
}
protected virtual async Task<ApiVersionInfo> GetApiVersionInfoAsync(ClientProxyRequestContext requestContext)
{
var apiVersion = await FindBestApiVersionAsync(requestContext);
//TODO: Make names configurable?
var versionParam = requestContext.Action.Parameters.FirstOrDefault(p => p.Name == "apiVersion" && p.BindingSourceId == ParameterBindingSources.Path) ??
requestContext.Action.Parameters.FirstOrDefault(p => p.Name == "api-version" && p.BindingSourceId == ParameterBindingSources.Query);
return new ApiVersionInfo(versionParam?.BindingSourceId, apiVersion);
}
protected virtual Task<string> GetUrlWithParametersAsync(ClientProxyRequestContext requestContext, ApiVersionInfo apiVersion)
{
return Task.FromResult(ClientProxyUrlBuilder.GenerateUrlWithParameters(requestContext.Action, requestContext.Arguments, apiVersion));
} }
private static string GetActionKey(string methodName, params object[] arguments) protected virtual Task<HttpContent> GetHttpContentAsync(ClientProxyRequestContext requestContext, ApiVersionInfo apiVersion)
{ {
return $"{typeof(TService).FullName}.{methodName}.{string.Join("-", arguments.Select(x => x.GetType().FullName))}"; return Task.FromResult(ClientProxyRequestPayloadBuilder.BuildContent(requestContext.Action, requestContext.Arguments, JsonSerializer, apiVersion));
}
protected virtual async Task<string> FindBestApiVersionAsync(ClientProxyRequestContext requestContext)
{
var configuredVersion = await GetConfiguredApiVersionAsync(requestContext);
if (requestContext.Action.SupportedVersions.IsNullOrEmpty())
{
return configuredVersion ?? "1.0";
}
if (requestContext.Action.SupportedVersions.Contains(configuredVersion))
{
return configuredVersion;
}
return requestContext.Action.SupportedVersions.Last(); //TODO: Ensure to get the latest version!
}
protected virtual async Task<string> GetConfiguredApiVersionAsync(ClientProxyRequestContext requestContext)
{
var clientConfig = ClientOptions.Value.HttpClientProxies.GetOrDefault(requestContext.ServiceType)
?? throw new AbpException($"Could not get DynamicHttpClientProxyConfig for {requestContext.ServiceType.FullName}.");
return (await RemoteServiceConfigurationProvider
.GetConfigurationOrDefaultOrNullAsync(clientConfig.RemoteServiceName))?.Version;
}
protected virtual async Task ThrowExceptionForResponseAsync(HttpResponseMessage response)
{
if (response.Headers.Contains(AbpHttpConsts.AbpErrorFormat))
{
var errorResponse = JsonSerializer.Deserialize<RemoteServiceErrorResponse>(
await response.Content.ReadAsStringAsync()
);
throw new AbpRemoteCallException(errorResponse.Error)
{
HttpStatusCode = (int) response.StatusCode
};
}
throw new AbpRemoteCallException(
new RemoteServiceErrorInfo
{
Message = response.ReasonPhrase,
Code = response.StatusCode.ToString()
}
)
{
HttpStatusCode = (int) response.StatusCode
};
}
protected virtual void AddHeaders(
IReadOnlyDictionary<string, object> argumentsDictionary,
ActionApiDescriptionModel action,
HttpRequestMessage requestMessage,
ApiVersionInfo apiVersion)
{
//API Version
if (!apiVersion.Version.IsNullOrEmpty())
{
//TODO: What about other media types?
requestMessage.Headers.Add("accept", $"{MimeTypes.Text.Plain}; v={apiVersion.Version}");
requestMessage.Headers.Add("accept", $"{MimeTypes.Application.Json}; v={apiVersion.Version}");
requestMessage.Headers.Add("api-version", apiVersion.Version);
}
//Header parameters
var headers = action.Parameters.Where(p => p.BindingSourceId == ParameterBindingSources.Header).ToArray();
foreach (var headerParameter in headers)
{
var value = HttpActionParameterHelper.FindParameterValue(argumentsDictionary, headerParameter);
if (value != null)
{
requestMessage.Headers.Add(headerParameter.Name, value.ToString());
}
}
//CorrelationId
requestMessage.Headers.Add(AbpCorrelationIdOptions.Value.HttpHeaderName, CorrelationIdProvider.Get());
//TenantId
if (CurrentTenant.Id.HasValue)
{
//TODO: Use AbpAspNetCoreMultiTenancyOptions to get the key
requestMessage.Headers.Add(TenantResolverConsts.DefaultTenantKey, CurrentTenant.Id.Value.ToString());
}
//Culture
//TODO: Is that the way we want? Couldn't send the culture (not ui culture)
var currentCulture = CultureInfo.CurrentUICulture.Name ?? CultureInfo.CurrentCulture.Name;
if (!currentCulture.IsNullOrEmpty())
{
requestMessage.Headers.AcceptLanguage.Add(new StringWithQualityHeaderValue(currentCulture));
}
//X-Requested-With
requestMessage.Headers.Add("X-Requested-With", "XMLHttpRequest");
}
protected virtual StringSegment RemoveQuotes(StringSegment input)
{
if (!StringSegment.IsNullOrEmpty(input) && input.Length >= 2 && input[0] == '"' && input[input.Length - 1] == '"')
{
input = input.Subsegment(1, input.Length - 2);
}
return input;
}
protected virtual CancellationToken GetCancellationToken(IReadOnlyDictionary<string, object> arguments)
{
var cancellationTokenArg = arguments.LastOrDefault();
if (cancellationTokenArg.Value is CancellationToken cancellationToken)
{
if (cancellationToken != default)
{
return cancellationToken;
}
}
return CancellationTokenProvider.Token;
} }
} }
} }

6
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/Proxying/HttpProxyExecuterContext.cs → framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyRequestContext.cs

@ -3,9 +3,9 @@ using System.Collections.Generic;
using JetBrains.Annotations; using JetBrains.Annotations;
using Volo.Abp.Http.Modeling; using Volo.Abp.Http.Modeling;
namespace Volo.Abp.Http.Client.Proxying namespace Volo.Abp.Http.Client.ClientProxying
{ {
public class HttpProxyExecuterContext public class ClientProxyRequestContext
{ {
[NotNull] [NotNull]
public ActionApiDescriptionModel Action { get; } public ActionApiDescriptionModel Action { get; }
@ -16,7 +16,7 @@ namespace Volo.Abp.Http.Client.Proxying
[NotNull] [NotNull]
public Type ServiceType { get; } public Type ServiceType { get; }
public HttpProxyExecuterContext( public ClientProxyRequestContext(
[NotNull] ActionApiDescriptionModel action, [NotNull] ActionApiDescriptionModel action,
[NotNull] IReadOnlyDictionary<string, object> arguments, [NotNull] IReadOnlyDictionary<string, object> arguments,
[NotNull] Type serviceType) [NotNull] Type serviceType)

13
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/Proxying/RequestPayloadBuilder.cs → framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyRequestPayloadBuilder.cs

@ -6,17 +6,18 @@ using System.Net.Http.Headers;
using System.Text; using System.Text;
using JetBrains.Annotations; using JetBrains.Annotations;
using Volo.Abp.Content; using Volo.Abp.Content;
using Volo.Abp.Http.Client.DynamicProxying; using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client.Proxying;
using Volo.Abp.Http.Modeling; using Volo.Abp.Http.Modeling;
using Volo.Abp.Http.ProxyScripting.Generators; using Volo.Abp.Http.ProxyScripting.Generators;
using Volo.Abp.Json; using Volo.Abp.Json;
namespace Volo.Abp.Http.Client.Proxying namespace Volo.Abp.Http.Client.ClientProxying
{ {
public static class RequestPayloadBuilder public class ClientProxyRequestPayloadBuilder : ITransientDependency
{ {
[CanBeNull] [CanBeNull]
public static HttpContent BuildContent(ActionApiDescriptionModel action, IReadOnlyDictionary<string, object> methodArguments, IJsonSerializer jsonSerializer, ApiVersionInfo apiVersion) public virtual HttpContent BuildContent(ActionApiDescriptionModel action, IReadOnlyDictionary<string, object> methodArguments, IJsonSerializer jsonSerializer, ApiVersionInfo apiVersion)
{ {
var body = GenerateBody(action, methodArguments, jsonSerializer); var body = GenerateBody(action, methodArguments, jsonSerializer);
if (body != null) if (body != null)
@ -29,7 +30,7 @@ namespace Volo.Abp.Http.Client.Proxying
return body; return body;
} }
private static HttpContent GenerateBody(ActionApiDescriptionModel action, IReadOnlyDictionary<string, object> methodArguments, IJsonSerializer jsonSerializer) protected virtual HttpContent GenerateBody(ActionApiDescriptionModel action, IReadOnlyDictionary<string, object> methodArguments, IJsonSerializer jsonSerializer)
{ {
var parameters = action var parameters = action
.Parameters .Parameters
@ -57,7 +58,7 @@ namespace Volo.Abp.Http.Client.Proxying
return new StringContent(jsonSerializer.Serialize(value), Encoding.UTF8, MimeTypes.Application.Json); return new StringContent(jsonSerializer.Serialize(value), Encoding.UTF8, MimeTypes.Application.Json);
} }
private static HttpContent GenerateFormPostData(ActionApiDescriptionModel action, IReadOnlyDictionary<string, object> methodArguments) protected virtual HttpContent GenerateFormPostData(ActionApiDescriptionModel action, IReadOnlyDictionary<string, object> methodArguments)
{ {
var parameters = action var parameters = action
.Parameters .Parameters

17
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/Proxying/UrlBuilder.cs → framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyUrlBuilder.cs

@ -5,16 +5,17 @@ using System.Globalization;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using JetBrains.Annotations; using JetBrains.Annotations;
using Volo.Abp.Http.Client.DynamicProxying; using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client.Proxying;
using Volo.Abp.Http.Modeling; using Volo.Abp.Http.Modeling;
using Volo.Abp.Http.ProxyScripting.Generators; using Volo.Abp.Http.ProxyScripting.Generators;
using Volo.Abp.Localization; using Volo.Abp.Localization;
namespace Volo.Abp.Http.Client.Proxying namespace Volo.Abp.Http.Client.ClientProxying
{ {
internal static class UrlBuilder public class ClientProxyUrlBuilder : ITransientDependency
{ {
public static string GenerateUrlWithParameters(ActionApiDescriptionModel action, IReadOnlyDictionary<string, object> methodArguments, ApiVersionInfo apiVersion) public string GenerateUrlWithParameters(ActionApiDescriptionModel action, IReadOnlyDictionary<string, object> methodArguments, ApiVersionInfo apiVersion)
{ {
// The ASP.NET Core route value provider and query string value provider: // The ASP.NET Core route value provider and query string value provider:
// Treat values as invariant culture. // Treat values as invariant culture.
@ -30,7 +31,7 @@ namespace Volo.Abp.Http.Client.Proxying
} }
} }
private static void ReplacePathVariables(StringBuilder urlBuilder, IList<ParameterApiDescriptionModel> actionParameters, IReadOnlyDictionary<string, object> methodArguments, ApiVersionInfo apiVersion) protected virtual void ReplacePathVariables(StringBuilder urlBuilder, IList<ParameterApiDescriptionModel> actionParameters, IReadOnlyDictionary<string, object> methodArguments, ApiVersionInfo apiVersion)
{ {
var pathParameters = actionParameters var pathParameters = actionParameters
.Where(p => p.BindingSourceId == ParameterBindingSources.Path) .Where(p => p.BindingSourceId == ParameterBindingSources.Path)
@ -72,7 +73,7 @@ namespace Volo.Abp.Http.Client.Proxying
} }
} }
private static void AddQueryStringParameters(StringBuilder urlBuilder, IList<ParameterApiDescriptionModel> actionParameters, IReadOnlyDictionary<string, object> methodArguments, ApiVersionInfo apiVersion) protected virtual void AddQueryStringParameters(StringBuilder urlBuilder, IList<ParameterApiDescriptionModel> actionParameters, IReadOnlyDictionary<string, object> methodArguments, ApiVersionInfo apiVersion)
{ {
var queryStringParameters = actionParameters var queryStringParameters = actionParameters
.Where(p => p.BindingSourceId.IsIn(ParameterBindingSources.ModelBinding, ParameterBindingSources.Query)) .Where(p => p.BindingSourceId.IsIn(ParameterBindingSources.ModelBinding, ParameterBindingSources.Query))
@ -100,7 +101,7 @@ namespace Volo.Abp.Http.Client.Proxying
} }
} }
private static bool AddQueryStringParameter( protected virtual bool AddQueryStringParameter(
StringBuilder urlBuilder, StringBuilder urlBuilder,
bool isFirstParam, bool isFirstParam,
string name, string name,
@ -133,7 +134,7 @@ namespace Volo.Abp.Http.Client.Proxying
return true; return true;
} }
private static string ConvertValueToString([CanBeNull] object value) protected virtual string ConvertValueToString([CanBeNull] object value)
{ {
if (value is DateTime dateTimeValue) if (value is DateTime dateTimeValue)
{ {

63
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs

@ -8,6 +8,7 @@ using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.DynamicProxy; using Volo.Abp.DynamicProxy;
using Volo.Abp.Http.Client.ClientProxying;
using Volo.Abp.Http.Client.Proxying; using Volo.Abp.Http.Client.Proxying;
using Volo.Abp.Http.Modeling; using Volo.Abp.Http.Modeling;
@ -15,32 +16,32 @@ namespace Volo.Abp.Http.Client.DynamicProxying
{ {
public class DynamicHttpProxyInterceptor<TService> : AbpInterceptor, ITransientDependency public class DynamicHttpProxyInterceptor<TService> : AbpInterceptor, ITransientDependency
{ {
// ReSharper disable once StaticMemberInGenericType // ReSharper disable once StaticMemberInGenericType
protected static MethodInfo MakeRequestAndGetResultAsyncMethod { get; } protected static MethodInfo CallRequestAsyncMethod { get; }
static DynamicHttpProxyInterceptor()
{
CallRequestAsyncMethod = typeof(DynamicHttpProxyInterceptor<TService>)
.GetMethods(BindingFlags.NonPublic | BindingFlags.Instance)
.First(m => m.Name == nameof(CallRequestAsync) && m.IsGenericMethodDefinition);
}
public ILogger<DynamicHttpProxyInterceptor<TService>> Logger { get; set; }
protected DynamicHttpProxyInterceptorClientProxy<TService> InterceptorClientProxy { get; }
protected AbpHttpClientOptions ClientOptions { get; } protected AbpHttpClientOptions ClientOptions { get; }
protected IHttpProxyExecuter HttpProxyExecuter { get; }
protected IProxyHttpClientFactory HttpClientFactory { get; } protected IProxyHttpClientFactory HttpClientFactory { get; }
protected IRemoteServiceConfigurationProvider RemoteServiceConfigurationProvider { get; } protected IRemoteServiceConfigurationProvider RemoteServiceConfigurationProvider { get; }
protected IApiDescriptionFinder ApiDescriptionFinder { get; } protected IApiDescriptionFinder ApiDescriptionFinder { get; }
public ILogger<DynamicHttpProxyInterceptor<TService>> Logger { get; set; }
static DynamicHttpProxyInterceptor()
{
MakeRequestAndGetResultAsyncMethod = typeof(HttpProxyExecuter)
.GetMethods(BindingFlags.Public | BindingFlags.Instance)
.First(m => m.Name == nameof(IHttpProxyExecuter.MakeRequestAndGetResultAsync) && m.IsGenericMethodDefinition);
}
public DynamicHttpProxyInterceptor( public DynamicHttpProxyInterceptor(
IHttpProxyExecuter httpProxyExecuter, DynamicHttpProxyInterceptorClientProxy<TService> interceptorClientProxy,
IOptions<AbpHttpClientOptions> clientOptions, IOptions<AbpHttpClientOptions> clientOptions,
IProxyHttpClientFactory httpClientFactory, IProxyHttpClientFactory httpClientFactory,
IRemoteServiceConfigurationProvider remoteServiceConfigurationProvider, IRemoteServiceConfigurationProvider remoteServiceConfigurationProvider,
IApiDescriptionFinder apiDescriptionFinder) IApiDescriptionFinder apiDescriptionFinder)
{ {
HttpProxyExecuter = httpProxyExecuter; InterceptorClientProxy = interceptorClientProxy;
HttpClientFactory = httpClientFactory; HttpClientFactory = httpClientFactory;
RemoteServiceConfigurationProvider = remoteServiceConfigurationProvider; RemoteServiceConfigurationProvider = remoteServiceConfigurationProvider;
ApiDescriptionFinder = apiDescriptionFinder; ApiDescriptionFinder = apiDescriptionFinder;
@ -49,34 +50,32 @@ namespace Volo.Abp.Http.Client.DynamicProxying
Logger = NullLogger<DynamicHttpProxyInterceptor<TService>>.Instance; Logger = NullLogger<DynamicHttpProxyInterceptor<TService>>.Instance;
} }
public override async Task InterceptAsync(IAbpMethodInvocation invocation) public override async Task InterceptAsync(IAbpMethodInvocation invocation)
{ {
var context = new HttpProxyExecuterContext( var context = new ClientProxyRequestContext(
await GetActionApiDescriptionModel(invocation), await GetActionApiDescriptionModel(invocation),
invocation.ArgumentsDictionary, invocation.ArgumentsDictionary,
typeof(TService)); typeof(TService));
if (invocation.Method.ReturnType.GenericTypeArguments.IsNullOrEmpty()) if (invocation.Method.ReturnType.GenericTypeArguments.IsNullOrEmpty())
{ {
await HttpProxyExecuter.MakeRequestAsync(context); await InterceptorClientProxy.CallRequestAsync(context);
} }
else else
{ {
var result = (Task)MakeRequestAndGetResultAsyncMethod var returnType = invocation.Method.ReturnType.GenericTypeArguments[0];
.MakeGenericMethod(invocation.Method.ReturnType.GenericTypeArguments[0]) var result = (Task)CallRequestAsyncMethod
.Invoke(HttpProxyExecuter, new object[] { context }); .MakeGenericMethod(returnType)
.Invoke(this, new object[] { context });
invocation.ReturnValue = await GetResultAsync( invocation.ReturnValue = await GetResultAsync(result, returnType);
result,
invocation.Method.ReturnType.GetGenericArguments()[0]
);
} }
} }
private async Task<ActionApiDescriptionModel> GetActionApiDescriptionModel(IAbpMethodInvocation invocation) protected virtual async Task<ActionApiDescriptionModel> GetActionApiDescriptionModel(IAbpMethodInvocation invocation)
{ {
var clientConfig = ClientOptions.HttpClientProxies.GetOrDefault(typeof(TService)) ?? throw new AbpException($"Could not get DynamicHttpClientProxyConfig for {typeof(TService).FullName}."); var clientConfig = ClientOptions.HttpClientProxies.GetOrDefault(typeof(TService)) ??
throw new AbpException($"Could not get DynamicHttpClientProxyConfig for {typeof(TService).FullName}.");
var remoteServiceConfig = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(clientConfig.RemoteServiceName); var remoteServiceConfig = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(clientConfig.RemoteServiceName);
var client = HttpClientFactory.Create(clientConfig.RemoteServiceName); var client = HttpClientFactory.Create(clientConfig.RemoteServiceName);
@ -88,13 +87,19 @@ namespace Volo.Abp.Http.Client.DynamicProxying
); );
} }
private async Task<object> GetResultAsync(Task task, Type resultType) protected virtual async Task<T> CallRequestAsync<T>(ClientProxyRequestContext context)
{
return await InterceptorClientProxy.CallRequestAsync<T>(context);
}
protected virtual async Task<object> GetResultAsync(Task task, Type resultType)
{ {
await task; await task;
return typeof(Task<>) var resultProperty = typeof(Task<>)
.MakeGenericType(resultType) .MakeGenericType(resultType)
.GetProperty(nameof(Task<object>.Result), BindingFlags.Instance | BindingFlags.Public) .GetProperty(nameof(Task<object>.Result), BindingFlags.Instance | BindingFlags.Public);
.GetValue(task); Check.NotNull(resultProperty, nameof(resultProperty));
return resultProperty.GetValue(task);
} }
} }
} }

19
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptorClientProxy.cs

@ -0,0 +1,19 @@
using System.Net.Http;
using System.Threading.Tasks;
using Volo.Abp.Http.Client.ClientProxying;
namespace Volo.Abp.Http.Client.DynamicProxying
{
public class DynamicHttpProxyInterceptorClientProxy<TService> : ClientProxyBase<TService>
{
public virtual async Task<T> CallRequestAsync<T>(ClientProxyRequestContext requestContext)
{
return await base.RequestAsync<T>(requestContext);
}
public virtual async Task<HttpContent> CallRequestAsync(ClientProxyRequestContext requestContext)
{
return await base.RequestAsync(requestContext);
}
}
}

267
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/Proxying/HttpProxyExecuter.cs

@ -1,267 +0,0 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Primitives;
using Volo.Abp.Content;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client.Authentication;
using Volo.Abp.Http.Modeling;
using Volo.Abp.Http.ProxyScripting.Generators;
using Volo.Abp.Json;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Threading;
using Volo.Abp.Tracing;
namespace Volo.Abp.Http.Client.Proxying
{
public class HttpProxyExecuter : IHttpProxyExecuter, ITransientDependency
{
protected ICancellationTokenProvider CancellationTokenProvider { get; }
protected ICorrelationIdProvider CorrelationIdProvider { get; }
protected ICurrentTenant CurrentTenant { get; }
protected AbpCorrelationIdOptions AbpCorrelationIdOptions { get; }
protected IProxyHttpClientFactory HttpClientFactory { get; }
protected IRemoteServiceConfigurationProvider RemoteServiceConfigurationProvider { get; }
protected AbpHttpClientOptions ClientOptions { get; }
protected IJsonSerializer JsonSerializer { get; }
protected IRemoteServiceHttpClientAuthenticator ClientAuthenticator { get; }
public HttpProxyExecuter(
ICancellationTokenProvider cancellationTokenProvider,
ICorrelationIdProvider correlationIdProvider,
ICurrentTenant currentTenant,
IOptions<AbpCorrelationIdOptions> abpCorrelationIdOptions,
IProxyHttpClientFactory httpClientFactory,
IRemoteServiceConfigurationProvider remoteServiceConfigurationProvider,
IOptions<AbpHttpClientOptions> clientOptions,
IRemoteServiceHttpClientAuthenticator clientAuthenticator,
IJsonSerializer jsonSerializer)
{
CancellationTokenProvider = cancellationTokenProvider;
CorrelationIdProvider = correlationIdProvider;
CurrentTenant = currentTenant;
AbpCorrelationIdOptions = abpCorrelationIdOptions.Value;
HttpClientFactory = httpClientFactory;
RemoteServiceConfigurationProvider = remoteServiceConfigurationProvider;
ClientOptions = clientOptions.Value;
ClientAuthenticator = clientAuthenticator;
JsonSerializer = jsonSerializer;
}
public virtual async Task<T> MakeRequestAndGetResultAsync<T>(HttpProxyExecuterContext context)
{
var responseContent = await MakeRequestAsync(context);
if (typeof(T) == typeof(IRemoteStreamContent) ||
typeof(T) == typeof(RemoteStreamContent))
{
/* returning a class that holds a reference to response
* content just to be sure that GC does not dispose of
* it before we finish doing our work with the stream */
return (T) (object) new RemoteStreamContent(
await responseContent.ReadAsStreamAsync(),
responseContent.Headers?.ContentDisposition?.FileNameStar ?? RemoveQuotes(responseContent.Headers?.ContentDisposition?.FileName).ToString(),
responseContent.Headers?.ContentType?.ToString(),
responseContent.Headers?.ContentLength);
}
var stringContent = await responseContent.ReadAsStringAsync();
if (typeof(T) == typeof(string))
{
return (T)(object)stringContent;
}
if (stringContent.IsNullOrWhiteSpace())
{
return default;
}
return JsonSerializer.Deserialize<T>(stringContent);
}
public virtual async Task<HttpContent> MakeRequestAsync(HttpProxyExecuterContext context)
{
var clientConfig = ClientOptions.HttpClientProxies.GetOrDefault(context.ServiceType) ?? throw new AbpException($"Could not get HttpClientProxyConfig for {context.ServiceType.FullName}.");
var remoteServiceConfig = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(clientConfig.RemoteServiceName);
var client = HttpClientFactory.Create(clientConfig.RemoteServiceName);
var apiVersion = await GetApiVersionInfoAsync(context);
var url = remoteServiceConfig.BaseUrl.EnsureEndsWith('/') + UrlBuilder.GenerateUrlWithParameters(context.Action, context.Arguments, apiVersion);
var requestMessage = new HttpRequestMessage(context.Action.GetHttpMethod(), url)
{
Content = RequestPayloadBuilder.BuildContent(context.Action, context.Arguments, JsonSerializer, apiVersion)
};
AddHeaders(context.Arguments, context.Action, requestMessage, apiVersion);
if (context.Action.AllowAnonymous != true)
{
await ClientAuthenticator.Authenticate(
new RemoteServiceHttpClientAuthenticateContext(
client,
requestMessage,
remoteServiceConfig,
clientConfig.RemoteServiceName
)
);
}
var response = await client.SendAsync(
requestMessage,
HttpCompletionOption.ResponseHeadersRead /*this will buffer only the headers, the content will be used as a stream*/,
GetCancellationToken(context.Arguments)
);
if (!response.IsSuccessStatusCode)
{
await ThrowExceptionForResponseAsync(response);
}
return response.Content;
}
private async Task<ApiVersionInfo> GetApiVersionInfoAsync(HttpProxyExecuterContext context)
{
var apiVersion = await FindBestApiVersionAsync(context);
//TODO: Make names configurable?
var versionParam = context.Action.Parameters.FirstOrDefault(p => p.Name == "apiVersion" && p.BindingSourceId == ParameterBindingSources.Path) ??
context.Action.Parameters.FirstOrDefault(p => p.Name == "api-version" && p.BindingSourceId == ParameterBindingSources.Query);
return new ApiVersionInfo(versionParam?.BindingSourceId, apiVersion);
}
private async Task<string> FindBestApiVersionAsync(HttpProxyExecuterContext context)
{
var configuredVersion = await GetConfiguredApiVersionAsync(context);
if (context.Action.SupportedVersions.IsNullOrEmpty())
{
return configuredVersion ?? "1.0";
}
if (context.Action.SupportedVersions.Contains(configuredVersion))
{
return configuredVersion;
}
return context.Action.SupportedVersions.Last(); //TODO: Ensure to get the latest version!
}
private async Task<string> GetConfiguredApiVersionAsync(HttpProxyExecuterContext context)
{
var clientConfig = ClientOptions.HttpClientProxies.GetOrDefault(context.ServiceType)
?? throw new AbpException($"Could not get DynamicHttpClientProxyConfig for {context.ServiceType.FullName}.");
return (await RemoteServiceConfigurationProvider
.GetConfigurationOrDefaultOrNullAsync(clientConfig.RemoteServiceName))?.Version;
}
private async Task ThrowExceptionForResponseAsync(HttpResponseMessage response)
{
if (response.Headers.Contains(AbpHttpConsts.AbpErrorFormat))
{
var errorResponse = JsonSerializer.Deserialize<RemoteServiceErrorResponse>(
await response.Content.ReadAsStringAsync()
);
throw new AbpRemoteCallException(errorResponse.Error)
{
HttpStatusCode = (int) response.StatusCode
};
}
throw new AbpRemoteCallException(
new RemoteServiceErrorInfo
{
Message = response.ReasonPhrase,
Code = response.StatusCode.ToString()
}
)
{
HttpStatusCode = (int) response.StatusCode
};
}
protected virtual void AddHeaders(
IReadOnlyDictionary<string, object> argumentsDictionary,
ActionApiDescriptionModel action,
HttpRequestMessage requestMessage,
ApiVersionInfo apiVersion)
{
//API Version
if (!apiVersion.Version.IsNullOrEmpty())
{
//TODO: What about other media types?
requestMessage.Headers.Add("accept", $"{MimeTypes.Text.Plain}; v={apiVersion.Version}");
requestMessage.Headers.Add("accept", $"{MimeTypes.Application.Json}; v={apiVersion.Version}");
requestMessage.Headers.Add("api-version", apiVersion.Version);
}
//Header parameters
var headers = action.Parameters.Where(p => p.BindingSourceId == ParameterBindingSources.Header).ToArray();
foreach (var headerParameter in headers)
{
var value = HttpActionParameterHelper.FindParameterValue(argumentsDictionary, headerParameter);
if (value != null)
{
requestMessage.Headers.Add(headerParameter.Name, value.ToString());
}
}
//CorrelationId
requestMessage.Headers.Add(AbpCorrelationIdOptions.HttpHeaderName, CorrelationIdProvider.Get());
//TenantId
if (CurrentTenant.Id.HasValue)
{
//TODO: Use AbpAspNetCoreMultiTenancyOptions to get the key
requestMessage.Headers.Add(TenantResolverConsts.DefaultTenantKey, CurrentTenant.Id.Value.ToString());
}
//Culture
//TODO: Is that the way we want? Couldn't send the culture (not ui culture)
var currentCulture = CultureInfo.CurrentUICulture.Name ?? CultureInfo.CurrentCulture.Name;
if (!currentCulture.IsNullOrEmpty())
{
requestMessage.Headers.AcceptLanguage.Add(new StringWithQualityHeaderValue(currentCulture));
}
//X-Requested-With
requestMessage.Headers.Add("X-Requested-With", "XMLHttpRequest");
}
protected virtual StringSegment RemoveQuotes(StringSegment input)
{
if (!StringSegment.IsNullOrEmpty(input) && input.Length >= 2 && input[0] == '"' && input[input.Length - 1] == '"')
{
input = input.Subsegment(1, input.Length - 2);
}
return input;
}
protected virtual CancellationToken GetCancellationToken(IReadOnlyDictionary<string, object> arguments)
{
var cancellationTokenArg = arguments.LastOrDefault();
if (cancellationTokenArg.Value is CancellationToken cancellationToken)
{
if (cancellationToken != default)
{
return cancellationToken;
}
}
return CancellationTokenProvider.Token;
}
}
}

12
framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/Proxying/IHttpProxyExecuter.cs

@ -1,12 +0,0 @@
using System.Net.Http;
using System.Threading.Tasks;
namespace Volo.Abp.Http.Client.Proxying
{
public interface IHttpProxyExecuter
{
Task<HttpContent> MakeRequestAsync(HttpProxyExecuterContext context);
Task<T> MakeRequestAndGetResultAsync<T>(HttpProxyExecuterContext context);
}
}

5
framework/test/Volo.Abp.Cli.Core.Tests/Volo/Abp/Cli/ProjectNameValidation_Tests.cs

@ -51,13 +51,16 @@ namespace Volo.Abp.Cli
{ {
var illegalKeywords = new[] var illegalKeywords = new[]
{ {
"Blazor" "Blazor"
}; };
foreach (var illegalKeyword in illegalKeywords) foreach (var illegalKeyword in illegalKeywords)
{ {
var args = new CommandLineArgs("new", illegalKeyword); var args = new CommandLineArgs("new", illegalKeyword);
await _newCommand.ExecuteAsync(args).ShouldThrowAsync<CliUsageException>(); await _newCommand.ExecuteAsync(args).ShouldThrowAsync<CliUsageException>();
args = new CommandLineArgs("new", "Acme." + illegalKeyword);
await _newCommand.ExecuteAsync(args).ShouldThrowAsync<CliUsageException>();
} }
} }

1
modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Password/AccountProfilePasswordManagementGroupViewComponent.cs

@ -2,6 +2,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.Widgets;
using Volo.Abp.Auditing; using Volo.Abp.Auditing;
using Volo.Abp.Identity; using Volo.Abp.Identity;
using Volo.Abp.Validation; using Volo.Abp.Validation;

1
modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/AccountProfilePersonalInfoManagementGroupViewComponent.cs

@ -2,6 +2,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.Widgets;
using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities;
using Volo.Abp.Identity; using Volo.Abp.Identity;
using Volo.Abp.Validation; using Volo.Abp.Validation;

22
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 Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.Modeling;
using Volo.Abp.Identity.EntityFrameworkCore;
namespace Volo.Abp.AuditLogging.EntityFrameworkCore namespace Volo.Abp.AuditLogging.EntityFrameworkCore
{ {
public static class AbpAuditLoggingDbContextModelBuilderExtensions public static class AbpAuditLoggingDbContextModelBuilderExtensions
{ {
public static void ConfigureAuditLogging( public static void ConfigureAuditLogging(
[NotNull] this ModelBuilder builder, [NotNull] this ModelBuilder builder)
Action<AbpAuditLoggingModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new AbpAuditLoggingModelBuilderConfigurationOptions(
AbpAuditLoggingDbProperties.DbTablePrefix,
AbpAuditLoggingDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<AuditLog>(b => builder.Entity<AuditLog>(b =>
{ {
b.ToTable(options.TablePrefix + "AuditLogs", options.Schema); b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogs", AbpAuditLoggingDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -56,7 +46,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
builder.Entity<AuditLogAction>(b => builder.Entity<AuditLogAction>(b =>
{ {
b.ToTable(options.TablePrefix + "AuditLogActions", options.Schema); b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogActions", AbpAuditLoggingDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -75,7 +65,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
builder.Entity<EntityChange>(b => builder.Entity<EntityChange>(b =>
{ {
b.ToTable(options.TablePrefix + "EntityChanges", options.Schema); b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "EntityChanges", AbpAuditLoggingDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -96,7 +86,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
builder.Entity<EntityPropertyChange>(b => builder.Entity<EntityPropertyChange>(b =>
{ {
b.ToTable(options.TablePrefix + "EntityPropertyChanges", options.Schema); b.ToTable(AbpAuditLoggingDbProperties.DbTablePrefix + "EntityPropertyChanges", AbpAuditLoggingDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();

18
modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingModelBuilderConfigurationOptions.cs

@ -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)
{
}
}
}

14
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 namespace Volo.Abp.AuditLogging.MongoDB
{ {
public static class AbpAuditLoggingMongoDbContextExtensions public static class AbpAuditLoggingMongoDbContextExtensions
{ {
public static void ConfigureAuditLogging( public static void ConfigureAuditLogging(
this IMongoModelBuilder builder, this IMongoModelBuilder builder)
Action<AuditLoggingMongoModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new AuditLoggingMongoModelBuilderConfigurationOptions(
AbpAuditLoggingDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<AuditLog>(b => builder.Entity<AuditLog>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "AuditLogs"; b.CollectionName = AbpAuditLoggingDbProperties.DbTablePrefix + "AuditLogs";
}); });
} }
} }

14
modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/AuditLoggingMongoModelBuilderConfigurationOptions.cs

@ -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)
{
}
}
}

12
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 class BackgroundJobsDbContextModelCreatingExtensions
{ {
public static void ConfigureBackgroundJobs( public static void ConfigureBackgroundJobs(
this ModelBuilder builder, this ModelBuilder builder)
Action<BackgroundJobsModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
@ -17,16 +16,9 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
return; return;
} }
var options = new BackgroundJobsModelBuilderConfigurationOptions(
BackgroundJobsDbProperties.DbTablePrefix,
BackgroundJobsDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<BackgroundJobRecord>(b => builder.Entity<BackgroundJobRecord>(b =>
{ {
b.ToTable(options.TablePrefix + "BackgroundJobs", options.Schema); b.ToTable(BackgroundJobsDbProperties.DbTablePrefix + "BackgroundJobs", BackgroundJobsDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();

18
modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsModelBuilderConfigurationOptions.cs

@ -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)
{
}
}
}

16
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 namespace Volo.Abp.BackgroundJobs.MongoDB
{ {
public static class BackgroundJobsMongoDbContextExtensions public static class BackgroundJobsMongoDbContextExtensions
{ {
public static void ConfigureBackgroundJobs( public static void ConfigureBackgroundJobs(
this IMongoModelBuilder builder, this IMongoModelBuilder builder)
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new BackgroundJobsMongoModelBuilderConfigurationOptions(
BackgroundJobsDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<BackgroundJobRecord>(b => builder.Entity<BackgroundJobRecord>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "BackgroundJobs"; b.CollectionName = BackgroundJobsDbProperties.DbTablePrefix + "BackgroundJobs";
}); });
} }
} }
} }

14
modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoModelBuilderConfigurationOptions.cs

@ -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)
{
}
}
}

15
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 Microsoft.EntityFrameworkCore;
using System;
using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore
@ -7,21 +6,13 @@ namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore
public static class BlobStoringDbContextModelCreatingExtensions public static class BlobStoringDbContextModelCreatingExtensions
{ {
public static void ConfigureBlobStoring( public static void ConfigureBlobStoring(
this ModelBuilder builder, this ModelBuilder builder)
Action<BlobStoringModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new BlobStoringModelBuilderConfigurationOptions(
BlobStoringDatabaseDbProperties.DbTablePrefix,
BlobStoringDatabaseDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<DatabaseBlobContainer>(b => builder.Entity<DatabaseBlobContainer>(b =>
{ {
b.ToTable(options.TablePrefix + "BlobContainers", options.Schema); b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers", BlobStoringDatabaseDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -36,7 +27,7 @@ namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore
builder.Entity<DatabaseBlob>(b => builder.Entity<DatabaseBlob>(b =>
{ {
b.ToTable(options.TablePrefix + "Blobs", options.Schema); b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs", BlobStoringDatabaseDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();

18
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringModelBuilderConfigurationOptions.cs

@ -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)
{
}
}
}

18
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 namespace Volo.Abp.BlobStoring.Database.MongoDB
{ {
public static class BlobStoringMongoDbContextExtensions public static class BlobStoringMongoDbContextExtensions
{ {
public static void ConfigureBlobStoring( public static void ConfigureBlobStoring(
this IMongoModelBuilder builder, this IMongoModelBuilder builder)
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new BlobStoringMongoModelBuilderConfigurationOptions(
BlobStoringDatabaseDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<DatabaseBlobContainer>(b => builder.Entity<DatabaseBlobContainer>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "BlobContainers"; b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers";
}); });
builder.Entity<DatabaseBlob>(b => builder.Entity<DatabaseBlob>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "Blobs"; b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs";
}); });
} }
} }
} }

14
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoModelBuilderConfigurationOptions.cs

@ -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)
{
}
}
}

5
modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs

@ -31,6 +31,7 @@ using Volo.Abp.Identity;
using Volo.Abp.Identity.Web; using Volo.Abp.Identity.Web;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement; using Volo.Abp.PermissionManagement;
using Volo.Abp.PermissionManagement.HttpApi;
using Volo.Abp.PermissionManagement.Identity; using Volo.Abp.PermissionManagement.Identity;
using Volo.Abp.Threading; using Volo.Abp.Threading;
using Volo.Abp.UI; using Volo.Abp.UI;
@ -44,8 +45,8 @@ namespace Volo.BloggingTestApp
{ {
[DependsOn( [DependsOn(
typeof(BloggingWebModule), typeof(BloggingWebModule),
typeof(BloggingHttpApiModule),
typeof(BloggingApplicationModule), typeof(BloggingApplicationModule),
typeof(BloggingHttpApiModule),
typeof(BloggingAdminWebModule), typeof(BloggingAdminWebModule),
typeof(BloggingAdminHttpApiModule), typeof(BloggingAdminHttpApiModule),
typeof(BloggingAdminApplicationModule), typeof(BloggingAdminApplicationModule),
@ -55,12 +56,14 @@ namespace Volo.BloggingTestApp
typeof(BloggingTestAppEntityFrameworkCoreModule), typeof(BloggingTestAppEntityFrameworkCoreModule),
#endif #endif
typeof(AbpAccountWebModule), typeof(AbpAccountWebModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpAccountApplicationModule), typeof(AbpAccountApplicationModule),
typeof(AbpIdentityWebModule), typeof(AbpIdentityWebModule),
typeof(AbpIdentityHttpApiModule), typeof(AbpIdentityHttpApiModule),
typeof(AbpIdentityApplicationModule), typeof(AbpIdentityApplicationModule),
typeof(AbpPermissionManagementDomainIdentityModule), typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpPermissionManagementApplicationModule), typeof(AbpPermissionManagementApplicationModule),
typeof(AbpPermissionManagementHttpApiModule),
typeof(BlobStoringDatabaseDomainModule), typeof(BlobStoringDatabaseDomainModule),
typeof(AbpAutofacModule), typeof(AbpAutofacModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule) typeof(AbpAspNetCoreMvcUiBasicThemeModule)

12
modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj

@ -15,19 +15,19 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" /> <PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> <PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Volo.Blogging.Admin.HttpApi\Volo.Blogging.Admin.HttpApi.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.HttpApi\Volo.Blogging.HttpApi.csproj" />
<ProjectReference Include="..\Volo.BloggingTestApp.EntityFrameworkCore\Volo.BloggingTestApp.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\Volo.BloggingTestApp.EntityFrameworkCore\Volo.BloggingTestApp.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.Application\Volo.Blogging.Application.csproj" /> <ProjectReference Include="..\..\src\Volo.Blogging.Application\Volo.Blogging.Application.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.Web\Volo.Blogging.Web.csproj" /> <ProjectReference Include="..\..\src\Volo.Blogging.Web\Volo.Blogging.Web.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.HttpApi\Volo.Blogging.HttpApi.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.Admin.Application\Volo.Blogging.Admin.Application.csproj" /> <ProjectReference Include="..\..\src\Volo.Blogging.Admin.Application\Volo.Blogging.Admin.Application.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.Admin.Web\Volo.Blogging.Admin.Web.csproj" /> <ProjectReference Include="..\..\src\Volo.Blogging.Admin.Web\Volo.Blogging.Admin.Web.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.Admin.HttpApi\Volo.Blogging.Admin.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" /> <ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" /> <ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
@ -35,7 +35,9 @@
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.HttpApi\Volo.Abp.PermissionManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.HttpApi\Volo.Abp.Account.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\blob-storing-database\src\Volo.Abp.BlobStoring.Database.Domain\Volo.Abp.BlobStoring.Database.Domain.csproj" /> <ProjectReference Include="..\..\..\..\modules\blob-storing-database\src\Volo.Abp.BlobStoring.Database.Domain\Volo.Abp.BlobStoring.Database.Domain.csproj" />
</ItemGroup> </ItemGroup>

25
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 Microsoft.EntityFrameworkCore;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.Modeling;
@ -15,8 +14,7 @@ namespace Volo.Blogging.EntityFrameworkCore
public static class BloggingDbContextModelBuilderExtensions public static class BloggingDbContextModelBuilderExtensions
{ {
public static void ConfigureBlogging( public static void ConfigureBlogging(
[NotNull] this ModelBuilder builder, [NotNull] this ModelBuilder builder)
Action<BloggingModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
@ -25,16 +23,9 @@ namespace Volo.Blogging.EntityFrameworkCore
return; return;
} }
var options = new BloggingModelBuilderConfigurationOptions(
BloggingDbProperties.DbTablePrefix,
BloggingDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<BlogUser>(b => builder.Entity<BlogUser>(b =>
{ {
b.ToTable(options.TablePrefix + "Users", options.Schema); b.ToTable(BloggingDbProperties.DbTablePrefix + "Users", BloggingDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.ConfigureAbpUser(); b.ConfigureAbpUser();
@ -44,7 +35,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity<Blog>(b => builder.Entity<Blog>(b =>
{ {
b.ToTable(options.TablePrefix + "Blogs", options.Schema); b.ToTable(BloggingDbProperties.DbTablePrefix + "Blogs", BloggingDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -57,7 +48,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity<Post>(b => builder.Entity<Post>(b =>
{ {
b.ToTable(options.TablePrefix + "Posts", options.Schema); b.ToTable(BloggingDbProperties.DbTablePrefix + "Posts", BloggingDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -77,7 +68,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity<Comment>(b => builder.Entity<Comment>(b =>
{ {
b.ToTable(options.TablePrefix + "Comments", options.Schema); b.ToTable(BloggingDbProperties.DbTablePrefix + "Comments", BloggingDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -93,7 +84,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity<Tag>(b => builder.Entity<Tag>(b =>
{ {
b.ToTable(options.TablePrefix + "Tags", options.Schema); b.ToTable(BloggingDbProperties.DbTablePrefix + "Tags", BloggingDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -108,7 +99,7 @@ namespace Volo.Blogging.EntityFrameworkCore
builder.Entity<PostTag>(b => builder.Entity<PostTag>(b =>
{ {
b.ToTable(options.TablePrefix + "PostTags", options.Schema); b.ToTable(BloggingDbProperties.DbTablePrefix + "PostTags", BloggingDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();

15
modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingModelBuilderConfigurationOptions.cs

@ -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)
{
}
}
}

22
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.Abp.MongoDB;
using Volo.Blogging.Blogs; using Volo.Blogging.Blogs;
using Volo.Blogging.Comments; using Volo.Blogging.Comments;
@ -11,40 +10,33 @@ namespace Volo.Blogging.MongoDB
public static class BloggingMongoDbContextExtensions public static class BloggingMongoDbContextExtensions
{ {
public static void ConfigureBlogging( public static void ConfigureBlogging(
this IMongoModelBuilder builder, this IMongoModelBuilder builder)
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new BloggingMongoModelBuilderConfigurationOptions(
BloggingDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<BlogUser>(b => builder.Entity<BlogUser>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "Users"; b.CollectionName = BloggingDbProperties.DbTablePrefix + "Users";
}); });
builder.Entity<Blog>(b => builder.Entity<Blog>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "Blogs"; b.CollectionName = BloggingDbProperties.DbTablePrefix + "Blogs";
}); });
builder.Entity<Post>(b => builder.Entity<Post>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "Posts"; b.CollectionName = BloggingDbProperties.DbTablePrefix + "Posts";
}); });
builder.Entity<Tagging.Tag>(b => builder.Entity<Tagging.Tag>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "Tags"; b.CollectionName = BloggingDbProperties.DbTablePrefix + "Tags";
}); });
builder.Entity<Comment>(b => builder.Entity<Comment>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "Comments"; b.CollectionName = BloggingDbProperties.DbTablePrefix + "Comments";
}); });
} }
} }

14
modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoModelBuilderConfigurationOptions.cs

@ -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)
{
}
}
}

1
modules/cms-kit/host/Volo.CmsKit.IdentityServer/CmsKitIdentityServerModule.cs

@ -49,6 +49,7 @@ namespace Volo.CmsKit
[DependsOn( [DependsOn(
typeof(AbpAccountWebIdentityServerModule), typeof(AbpAccountWebIdentityServerModule),
typeof(AbpAccountApplicationModule), typeof(AbpAccountApplicationModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule), typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
typeof(AbpAspNetCoreMvcModule), typeof(AbpAspNetCoreMvcModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule), typeof(AbpAspNetCoreMvcUiBasicThemeModule),

1
modules/cms-kit/host/Volo.CmsKit.IdentityServer/Volo.CmsKit.IdentityServer.csproj

@ -23,6 +23,7 @@
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Serilog\Volo.Abp.AspNetCore.Serilog.csproj" /> <ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Serilog\Volo.Abp.AspNetCore.Serilog.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Web.IdentityServer\Volo.Abp.Account.Web.IdentityServer.csproj" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Web.IdentityServer\Volo.Abp.Account.Web.IdentityServer.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.HttpApi\Volo.Abp.Account.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.EntityFrameworkCore\Volo.Abp.IdentityServer.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.EntityFrameworkCore\Volo.Abp.IdentityServer.EntityFrameworkCore.csproj" />

3123
modules/cms-kit/host/Volo.CmsKit.IdentityServer/wwwroot/libs/sweetalert2/sweetalert2.all.js

File diff suppressed because one or more lines are too long

2
modules/cms-kit/host/Volo.CmsKit.IdentityServer/wwwroot/libs/sweetalert2/sweetalert2.all.min.js

File diff suppressed because one or more lines are too long

1319
modules/cms-kit/host/Volo.CmsKit.IdentityServer/wwwroot/libs/sweetalert2/sweetalert2.css

File diff suppressed because it is too large

3121
modules/cms-kit/host/Volo.CmsKit.IdentityServer/wwwroot/libs/sweetalert2/sweetalert2.js

File diff suppressed because it is too large

1
modules/cms-kit/host/Volo.CmsKit.IdentityServer/wwwroot/libs/sweetalert2/sweetalert2.min.css

File diff suppressed because one or more lines are too long

1
modules/cms-kit/host/Volo.CmsKit.IdentityServer/wwwroot/libs/sweetalert2/sweetalert2.min.js

File diff suppressed because one or more lines are too long

3123
modules/cms-kit/host/Volo.CmsKit.Web.Host/wwwroot/libs/sweetalert2/sweetalert2.all.js

File diff suppressed because one or more lines are too long

2
modules/cms-kit/host/Volo.CmsKit.Web.Host/wwwroot/libs/sweetalert2/sweetalert2.all.min.js

File diff suppressed because one or more lines are too long

1319
modules/cms-kit/host/Volo.CmsKit.Web.Host/wwwroot/libs/sweetalert2/sweetalert2.css

File diff suppressed because it is too large

3121
modules/cms-kit/host/Volo.CmsKit.Web.Host/wwwroot/libs/sweetalert2/sweetalert2.js

File diff suppressed because it is too large

1
modules/cms-kit/host/Volo.CmsKit.Web.Host/wwwroot/libs/sweetalert2/sweetalert2.min.css

File diff suppressed because one or more lines are too long

1
modules/cms-kit/host/Volo.CmsKit.Web.Host/wwwroot/libs/sweetalert2/sweetalert2.min.js

File diff suppressed because one or more lines are too long

11
modules/cms-kit/host/Volo.CmsKit.Web.Unified/CmsKitWebUnifiedModule.cs

@ -40,6 +40,7 @@ using Volo.Abp.VirtualFileSystem;
using Volo.CmsKit.Admin.Web; using Volo.CmsKit.Admin.Web;
using Volo.CmsKit.Public.Web; using Volo.CmsKit.Public.Web;
using System; using System;
using Volo.Abp.PermissionManagement.HttpApi;
using Volo.CmsKit.Tags; using Volo.CmsKit.Tags;
using Volo.CmsKit.Comments; using Volo.CmsKit.Comments;
using Volo.CmsKit.MediaDescriptors; using Volo.CmsKit.MediaDescriptors;
@ -51,24 +52,30 @@ namespace Volo.CmsKit
[DependsOn( [DependsOn(
typeof(CmsKitWebModule), typeof(CmsKitWebModule),
typeof(CmsKitApplicationModule), typeof(CmsKitApplicationModule),
typeof(CmsKitHttpApiModule),
typeof(CmsKitEntityFrameworkCoreModule), typeof(CmsKitEntityFrameworkCoreModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule),
typeof(AbpAutofacModule), typeof(AbpAutofacModule),
typeof(AbpAccountWebModule), typeof(AbpAccountWebModule),
typeof(AbpAccountApplicationModule), typeof(AbpAccountApplicationModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementApplicationModule), typeof(AbpPermissionManagementApplicationModule),
typeof(AbpPermissionManagementHttpApiModule),
typeof(AbpIdentityWebModule), typeof(AbpIdentityWebModule),
typeof(AbpIdentityApplicationModule), typeof(AbpIdentityApplicationModule),
typeof(AbpIdentityHttpApiModule),
typeof(AbpIdentityEntityFrameworkCoreModule), typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpPermissionManagementDomainIdentityModule), typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpFeatureManagementApplicationModule), typeof(AbpFeatureManagementApplicationModule),
typeof(AbpFeatureManagementHttpApiModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule), typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementWebModule), typeof(AbpFeatureManagementWebModule),
typeof(AbpTenantManagementWebModule), typeof(AbpTenantManagementWebModule),
typeof(AbpTenantManagementApplicationModule), typeof(AbpTenantManagementApplicationModule),
typeof(AbpTenantManagementHttpApiModule),
typeof(AbpTenantManagementEntityFrameworkCoreModule), typeof(AbpTenantManagementEntityFrameworkCoreModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule), typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreSerilogModule), typeof(AbpAspNetCoreSerilogModule),
@ -161,11 +168,11 @@ namespace Volo.CmsKit
{ {
options.EntityTypes.Add(new MediaDescriptorDefinition("quote")); options.EntityTypes.Add(new MediaDescriptorDefinition("quote"));
}); });
Configure<CmsKitReactionOptions>(options => Configure<CmsKitReactionOptions>(options =>
{ {
options.EntityTypes.Add( options.EntityTypes.Add(
new ReactionEntityTypeDefinition("quote", new ReactionEntityTypeDefinition("quote",
reactions: new[] reactions: new[]
{ {
new ReactionDefinition(StandardReactions.ThumbsUp), new ReactionDefinition(StandardReactions.ThumbsUp),

6
modules/cms-kit/host/Volo.CmsKit.Web.Unified/Volo.CmsKit.Web.Unified.csproj

@ -19,17 +19,22 @@
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.HttpApi\Volo.Abp.Account.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.HttpApi\Volo.Abp.PermissionManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.EntityFrameworkCore\Volo.Abp.FeatureManagement.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.EntityFrameworkCore\Volo.Abp.FeatureManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Application\Volo.Abp.FeatureManagement.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Application\Volo.Abp.FeatureManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.HttpApi\Volo.Abp.FeatureManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Web\Volo.Abp.FeatureManagement.Web.csproj" /> <ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Web\Volo.Abp.FeatureManagement.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Application\Volo.Abp.TenantManagement.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Application\Volo.Abp.TenantManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.HttpApi\Volo.Abp.TenantManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Web\Volo.Abp.TenantManagement.Web.csproj" /> <ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Web\Volo.Abp.TenantManagement.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.EntityFrameworkCore\Volo.Abp.TenantManagement.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.EntityFrameworkCore\Volo.Abp.TenantManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\blob-storing-database\src\Volo.Abp.BlobStoring.Database.EntityFrameworkCore\Volo.Abp.BlobStoring.Database.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\..\..\modules\blob-storing-database\src\Volo.Abp.BlobStoring.Database.EntityFrameworkCore\Volo.Abp.BlobStoring.Database.EntityFrameworkCore.csproj" />
@ -37,6 +42,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Volo.CmsKit.Application\Volo.CmsKit.Application.csproj" /> <ProjectReference Include="..\..\src\Volo.CmsKit.Application\Volo.CmsKit.Application.csproj" />
<ProjectReference Include="..\..\src\Volo.CmsKit.HttpApi\Volo.CmsKit.HttpApi.csproj" />
<ProjectReference Include="..\..\src\Volo.CmsKit.EntityFrameworkCore\Volo.CmsKit.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\src\Volo.CmsKit.EntityFrameworkCore\Volo.CmsKit.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\src\Volo.CmsKit.Application\Volo.CmsKit.Application.csproj" /> <ProjectReference Include="..\..\src\Volo.CmsKit.Application\Volo.CmsKit.Application.csproj" />
<ProjectReference Include="..\..\src\Volo.CmsKit.Web\Volo.CmsKit.Web.csproj" /> <ProjectReference Include="..\..\src\Volo.CmsKit.Web\Volo.CmsKit.Web.csproj" />

3123
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/sweetalert2/sweetalert2.all.js

File diff suppressed because one or more lines are too long

2
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/sweetalert2/sweetalert2.all.min.js

File diff suppressed because one or more lines are too long

1319
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/sweetalert2/sweetalert2.css

File diff suppressed because it is too large

3121
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/sweetalert2/sweetalert2.js

File diff suppressed because it is too large

1
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/sweetalert2/sweetalert2.min.css

File diff suppressed because one or more lines are too long

1
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/sweetalert2/sweetalert2.min.js

File diff suppressed because one or more lines are too long

3
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Menus/MenuItemAdminAppService.cs

@ -60,7 +60,8 @@ namespace Volo.CmsKit.Admin.Menus
input.Order, input.Order,
input.Target, input.Target,
input.ElementId, input.ElementId,
input.CssClass input.CssClass,
CurrentTenant.Id
); );
await MenuItemRepository.InsertAsync(menuItem); await MenuItemRepository.InsertAsync(menuItem);

12
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Menus/MenuItem.cs

@ -23,7 +23,7 @@ namespace Volo.CmsKit.Menus
public string DisplayName { get; protected set; } public string DisplayName { get; protected set; }
public bool IsActive { get; set; } public bool IsActive { get; set; }
[NotNull] [NotNull]
public string Url { get; protected set; } public string Url { get; protected set; }
@ -39,7 +39,7 @@ namespace Volo.CmsKit.Menus
public Guid? PageId { get; protected set; } public Guid? PageId { get; protected set; }
public Guid? TenantId { get; protected set; } public Guid? TenantId { get; protected set; }
public MenuItem(Guid id, public MenuItem(Guid id,
[NotNull] string displayName, [NotNull] string displayName,
@ -50,8 +50,9 @@ namespace Volo.CmsKit.Menus
int order = 0, int order = 0,
[CanBeNull] string target = null, [CanBeNull] string target = null,
[CanBeNull] string elementId = null, [CanBeNull] string elementId = null,
[CanBeNull] string cssClass = null) [CanBeNull] string cssClass = null,
:base(id) [CanBeNull] Guid? tenantId = null)
: base(id)
{ {
SetDisplayName(displayName); SetDisplayName(displayName);
IsActive = isActive; IsActive = isActive;
@ -62,6 +63,7 @@ namespace Volo.CmsKit.Menus
Target = target; Target = target;
ElementId = elementId; ElementId = elementId;
CssClass = cssClass; CssClass = cssClass;
TenantId = tenantId;
} }
public void SetDisplayName([NotNull] string displayName) public void SetDisplayName([NotNull] string displayName)
@ -69,7 +71,7 @@ namespace Volo.CmsKit.Menus
DisplayName = Check.NotNullOrEmpty(displayName, nameof(displayName), MenuItemConsts.MaxDisplayNameLength); DisplayName = Check.NotNullOrEmpty(displayName, nameof(displayName), MenuItemConsts.MaxDisplayNameLength);
} }
public void SetUrl([NotNull]string url) public void SetUrl([NotNull] string url)
{ {
Url = Check.NotNullOrEmpty(url, nameof(url), MenuItemConsts.MaxUrlLength); Url = Check.NotNullOrEmpty(url, nameof(url), MenuItemConsts.MaxUrlLength);
} }

35
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs

@ -1,5 +1,4 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.Modeling;
using Volo.Abp.GlobalFeatures; using Volo.Abp.GlobalFeatures;
@ -20,23 +19,15 @@ namespace Volo.CmsKit.EntityFrameworkCore
public static class CmsKitDbContextModelCreatingExtensions public static class CmsKitDbContextModelCreatingExtensions
{ {
public static void ConfigureCmsKit( public static void ConfigureCmsKit(
this ModelBuilder builder, this ModelBuilder builder)
Action<CmsKitModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new CmsKitModelBuilderConfigurationOptions(
CmsKitDbProperties.DbTablePrefix,
CmsKitDbProperties.DbSchema
);
optionsAction?.Invoke(options);
if (GlobalFeatureManager.Instance.IsEnabled<CmsUserFeature>()) if (GlobalFeatureManager.Instance.IsEnabled<CmsUserFeature>())
{ {
builder.Entity<CmsUser>(b => builder.Entity<CmsUser>(b =>
{ {
b.ToTable(options.TablePrefix + "Users", options.Schema); b.ToTable(CmsKitDbProperties.DbTablePrefix + "Users", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.ConfigureAbpUser(); b.ConfigureAbpUser();
@ -56,7 +47,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{ {
builder.Entity<UserReaction>(b => builder.Entity<UserReaction>(b =>
{ {
b.ToTable(options.TablePrefix + "UserReactions", options.Schema); b.ToTable(CmsKitDbProperties.DbTablePrefix + "UserReactions", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -79,7 +70,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{ {
builder.Entity<Comment>(b => builder.Entity<Comment>(b =>
{ {
b.ToTable(options.TablePrefix + "Comments", options.Schema); b.ToTable(CmsKitDbProperties.DbTablePrefix + "Comments", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -103,7 +94,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{ {
builder.Entity<Rating>(r => builder.Entity<Rating>(r =>
{ {
r.ToTable(options.TablePrefix + "Ratings", options.Schema); r.ToTable(CmsKitDbProperties.DbTablePrefix + "Ratings", CmsKitDbProperties.DbSchema);
r.ConfigureByConvention(); r.ConfigureByConvention();
@ -125,7 +116,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{ {
builder.Entity<Tag>(b => builder.Entity<Tag>(b =>
{ {
b.ToTable(options.TablePrefix + "Tags", options.Schema); b.ToTable(CmsKitDbProperties.DbTablePrefix + "Tags", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -143,7 +134,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
builder.Entity<EntityTag>(b => builder.Entity<EntityTag>(b =>
{ {
b.ToTable(options.TablePrefix + "EntityTags", options.Schema); b.ToTable(CmsKitDbProperties.DbTablePrefix + "EntityTags", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -167,7 +158,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{ {
builder.Entity<Page>(b => builder.Entity<Page>(b =>
{ {
b.ToTable(options.TablePrefix + "Pages", options.Schema); b.ToTable(CmsKitDbProperties.DbTablePrefix + "Pages", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -189,7 +180,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{ {
builder.Entity<Blog>(b => builder.Entity<Blog>(b =>
{ {
b.ToTable(options.TablePrefix + "Blogs", options.Schema); b.ToTable(CmsKitDbProperties.DbTablePrefix + "Blogs", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -202,7 +193,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
builder.Entity<BlogPost>(b => builder.Entity<BlogPost>(b =>
{ {
b.ToTable(options.TablePrefix + "BlogPosts", options.Schema); b.ToTable(CmsKitDbProperties.DbTablePrefix + "BlogPosts", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -219,7 +210,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
builder.Entity<BlogFeature>(b => builder.Entity<BlogFeature>(b =>
{ {
b.ToTable(options.TablePrefix + "BlogFeatures", options.Schema); b.ToTable(CmsKitDbProperties.DbTablePrefix + "BlogFeatures", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -239,7 +230,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{ {
builder.Entity<MediaDescriptor>(b => builder.Entity<MediaDescriptor>(b =>
{ {
b.ToTable(options.TablePrefix + "MediaDescriptors", options.Schema); b.ToTable(CmsKitDbProperties.DbTablePrefix + "MediaDescriptors", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -260,7 +251,7 @@ namespace Volo.CmsKit.EntityFrameworkCore
{ {
builder.Entity<MenuItem>(b => builder.Entity<MenuItem>(b =>
{ {
b.ToTable(options.TablePrefix + "MenuItems", options.Schema); b.ToTable(CmsKitDbProperties.DbTablePrefix + "MenuItems", CmsKitDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();

18
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitModelBuilderConfigurationOptions.cs

@ -1,18 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.CmsKit.EntityFrameworkCore
{
public class CmsKitModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public CmsKitModelBuilderConfigurationOptions(
[NotNull] string tablePrefix = "",
[CanBeNull] string schema = null)
: base(
tablePrefix,
schema)
{
}
}
}

12
modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs

@ -1,5 +1,4 @@
using System; using Volo.Abp;
using Volo.Abp;
using Volo.Abp.MongoDB; using Volo.Abp.MongoDB;
using Volo.CmsKit.Blogs; using Volo.CmsKit.Blogs;
using Volo.CmsKit.Comments; using Volo.CmsKit.Comments;
@ -16,17 +15,10 @@ namespace Volo.CmsKit.MongoDB
public static class CmsKitMongoDbContextExtensions public static class CmsKitMongoDbContextExtensions
{ {
public static void ConfigureCmsKit( public static void ConfigureCmsKit(
this IMongoModelBuilder builder, this IMongoModelBuilder builder)
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new CmsKitMongoModelBuilderConfigurationOptions(
CmsKitDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<CmsUser>(x => builder.Entity<CmsUser>(x =>
{ {
x.CollectionName = CmsKitDbProperties.DbTablePrefix + "Users"; x.CollectionName = CmsKitDbProperties.DbTablePrefix + "Users";

14
modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoModelBuilderConfigurationOptions.cs

@ -1,14 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.CmsKit.MongoDB
{
public class CmsKitMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public CmsKitMongoModelBuilderConfigurationOptions(
[NotNull] string collectionPrefix = "")
: base(collectionPrefix)
{
}
}
}

5
modules/docs/app/VoloDocs.Web/VoloDocs.Web.csproj

@ -24,18 +24,23 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Volo.Docs.Application\Volo.Docs.Application.csproj" /> <ProjectReference Include="..\..\src\Volo.Docs.Application\Volo.Docs.Application.csproj" />
<ProjectReference Include="..\..\src\Volo.Docs.HttpApi\Volo.Docs.HttpApi.csproj" />
<ProjectReference Include="..\..\src\Volo.Docs.Admin.Application\Volo.Docs.Admin.Application.csproj" /> <ProjectReference Include="..\..\src\Volo.Docs.Admin.Application\Volo.Docs.Admin.Application.csproj" />
<ProjectReference Include="..\..\src\Volo.Docs.Admin.HttpApi\Volo.Docs.Admin.HttpApi.csproj" />
<ProjectReference Include="..\..\src\Volo.Docs.Web\Volo.Docs.Web.csproj" /> <ProjectReference Include="..\..\src\Volo.Docs.Web\Volo.Docs.Web.csproj" />
<ProjectReference Include="..\..\src\Volo.Docs.Admin.Web\Volo.Docs.Admin.Web.csproj" /> <ProjectReference Include="..\..\src\Volo.Docs.Admin.Web\Volo.Docs.Admin.Web.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" /> <ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" /> <ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\VoloDocs.EntityFrameworkCore\VoloDocs.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\VoloDocs.EntityFrameworkCore\VoloDocs.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.HttpApi\Volo.Abp.PermissionManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.HttpApi\Volo.Abp.Account.HttpApi.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

10
modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs

@ -32,6 +32,7 @@ using Localization.Resources.AbpUi;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Volo.Abp.Account; using Volo.Abp.Account;
using Volo.Abp.PermissionManagement.HttpApi;
using Volo.Abp.Validation.Localization; using Volo.Abp.Validation.Localization;
using Volo.Docs.Documents.FullSearch.Elastic; using Volo.Docs.Documents.FullSearch.Elastic;
@ -41,15 +42,20 @@ namespace VoloDocs.Web
typeof(DocsWebModule), typeof(DocsWebModule),
typeof(DocsAdminWebModule), typeof(DocsAdminWebModule),
typeof(DocsApplicationModule), typeof(DocsApplicationModule),
typeof(DocsHttpApiModule),
typeof(DocsAdminApplicationModule), typeof(DocsAdminApplicationModule),
typeof(DocsAdminHttpApiModule),
typeof(VoloDocsEntityFrameworkCoreModule), typeof(VoloDocsEntityFrameworkCoreModule),
typeof(AbpAutofacModule), typeof(AbpAutofacModule),
typeof(AbpAccountWebModule), typeof(AbpAccountWebModule),
typeof(AbpAccountApplicationModule), typeof(AbpAccountApplicationModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpIdentityWebModule), typeof(AbpIdentityWebModule),
typeof(AbpIdentityApplicationModule), typeof(AbpIdentityApplicationModule),
typeof(AbpIdentityHttpApiModule),
typeof(AbpPermissionManagementDomainIdentityModule), typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpPermissionManagementApplicationModule), typeof(AbpPermissionManagementApplicationModule),
typeof(AbpPermissionManagementHttpApiModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule) typeof(AbpAspNetCoreMvcUiBasicThemeModule)
)] )]
public class VoloDocsWebModule : AbpModule public class VoloDocsWebModule : AbpModule
@ -113,7 +119,7 @@ namespace VoloDocs.Web
options.DocInclusionPredicate((docName, description) => true); options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName); options.CustomSchemaIds(type => type.FullName);
}); });
Configure<AbpVirtualFileSystemOptions>(options => Configure<AbpVirtualFileSystemOptions>(options =>
{ {
options.FileSets.AddEmbedded<VoloDocsWebModule>("VoloDocs.Web"); options.FileSets.AddEmbedded<VoloDocsWebModule>("VoloDocs.Web");
@ -170,7 +176,7 @@ namespace VoloDocs.Web
}); });
app.UseStatusCodePagesWithReExecute("/error/{0}"); app.UseStatusCodePagesWithReExecute("/error/{0}");
//app.UseMiddleware<GlobalExceptionHandlerMiddleware>(); //app.UseMiddleware<GlobalExceptionHandlerMiddleware>();
app.UseConfiguredEndpoints(); app.UseConfiguredEndpoints();

3123
modules/docs/app/VoloDocs.Web/wwwroot/libs/sweetalert2/sweetalert2.all.js

File diff suppressed because one or more lines are too long

2
modules/docs/app/VoloDocs.Web/wwwroot/libs/sweetalert2/sweetalert2.all.min.js

File diff suppressed because one or more lines are too long

1319
modules/docs/app/VoloDocs.Web/wwwroot/libs/sweetalert2/sweetalert2.css

File diff suppressed because it is too large

3121
modules/docs/app/VoloDocs.Web/wwwroot/libs/sweetalert2/sweetalert2.js

File diff suppressed because it is too large

1
modules/docs/app/VoloDocs.Web/wwwroot/libs/sweetalert2/sweetalert2.min.css

File diff suppressed because one or more lines are too long

1
modules/docs/app/VoloDocs.Web/wwwroot/libs/sweetalert2/sweetalert2.min.js

File diff suppressed because one or more lines are too long

19
modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs

@ -1,5 +1,4 @@
using System; using JetBrains.Annotations;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.Modeling;
@ -11,8 +10,7 @@ namespace Volo.Docs.EntityFrameworkCore
public static class DocsDbContextModelBuilderExtensions public static class DocsDbContextModelBuilderExtensions
{ {
public static void ConfigureDocs( public static void ConfigureDocs(
[NotNull] this ModelBuilder builder, [NotNull] this ModelBuilder builder)
Action<DocsModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
@ -21,16 +19,9 @@ namespace Volo.Docs.EntityFrameworkCore
return; return;
} }
var options = new DocsModelBuilderConfigurationOptions(
DocsDbProperties.DbTablePrefix,
DocsDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<Project>(b => builder.Entity<Project>(b =>
{ {
b.ToTable(options.TablePrefix + "Projects", options.Schema); b.ToTable(DocsDbProperties.DbTablePrefix + "Projects", DocsDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -46,7 +37,7 @@ namespace Volo.Docs.EntityFrameworkCore
builder.Entity<Document>(b => builder.Entity<Document>(b =>
{ {
b.ToTable(options.TablePrefix + "Documents", options.Schema); b.ToTable(DocsDbProperties.DbTablePrefix + "Documents", DocsDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -70,7 +61,7 @@ namespace Volo.Docs.EntityFrameworkCore
builder.Entity<DocumentContributor>(b => builder.Entity<DocumentContributor>(b =>
{ {
b.ToTable(options.TablePrefix + "DocumentContributors", options.Schema); b.ToTable(DocsDbProperties.DbTablePrefix + "DocumentContributors", DocsDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();

15
modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsModelBuilderConfigurationOptions.cs

@ -1,15 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Docs.EntityFrameworkCore
{
public class DocsModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public DocsModelBuilderConfigurationOptions(
[NotNull] string tablePrefix,
[CanBeNull] string schema)
: base(tablePrefix, schema)
{
}
}
}

16
modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContextExtensions.cs

@ -1,5 +1,4 @@
using System; using Volo.Abp;
using Volo.Abp;
using Volo.Abp.MongoDB; using Volo.Abp.MongoDB;
using Volo.Docs.Documents; using Volo.Docs.Documents;
using Volo.Docs.Projects; using Volo.Docs.Projects;
@ -9,25 +8,18 @@ namespace Volo.Docs.MongoDB
public static class DocsMongoDbContextExtensions public static class DocsMongoDbContextExtensions
{ {
public static void ConfigureDocs( public static void ConfigureDocs(
this IMongoModelBuilder builder, this IMongoModelBuilder builder)
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new DocsMongoModelBuilderConfigurationOptions(
DocsDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<Project>(b => builder.Entity<Project>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "Projects"; b.CollectionName = DocsDbProperties.DbTablePrefix + "Projects";
}); });
builder.Entity<Document>(b => builder.Entity<Document>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "DocumentS"; b.CollectionName = DocsDbProperties.DbTablePrefix + "DocumentS";
}); });
} }
} }

14
modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoModelBuilderConfigurationOptions.cs

@ -1,14 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.Docs.MongoDB
{
public class DocsMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public DocsMongoModelBuilderConfigurationOptions(
[NotNull] string collectionPrefix)
: base(collectionPrefix)
{
}
}
}

12
modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContextModelCreatingExtensions.cs

@ -7,8 +7,7 @@ namespace Volo.Abp.FeatureManagement.EntityFrameworkCore
public static class FeatureManagementDbContextModelCreatingExtensions public static class FeatureManagementDbContextModelCreatingExtensions
{ {
public static void ConfigureFeatureManagement( public static void ConfigureFeatureManagement(
this ModelBuilder builder, this ModelBuilder builder)
Action<FeatureManagementModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
@ -17,16 +16,9 @@ namespace Volo.Abp.FeatureManagement.EntityFrameworkCore
return; return;
} }
var options = new FeatureManagementModelBuilderConfigurationOptions(
FeatureManagementDbProperties.DbTablePrefix,
FeatureManagementDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<FeatureValue>(b => builder.Entity<FeatureValue>(b =>
{ {
b.ToTable(options.TablePrefix + "FeatureValues", options.Schema); b.ToTable(FeatureManagementDbProperties.DbTablePrefix + "FeatureValues", FeatureManagementDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();

18
modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementModelBuilderConfigurationOptions.cs

@ -1,18 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.FeatureManagement.EntityFrameworkCore
{
public class FeatureManagementModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public FeatureManagementModelBuilderConfigurationOptions(
[NotNull] string tablePrefix = "",
[CanBeNull] string schema = null)
: base(
tablePrefix,
schema)
{
}
}
}

14
modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContextExtensions.cs

@ -1,25 +1,17 @@
using System; using Volo.Abp.MongoDB;
using Volo.Abp.MongoDB;
namespace Volo.Abp.FeatureManagement.MongoDB namespace Volo.Abp.FeatureManagement.MongoDB
{ {
public static class FeatureManagementMongoDbContextExtensions public static class FeatureManagementMongoDbContextExtensions
{ {
public static void ConfigureFeatureManagement( public static void ConfigureFeatureManagement(
this IMongoModelBuilder builder, this IMongoModelBuilder builder)
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new FeatureManagementMongoModelBuilderConfigurationOptions(
FeatureManagementDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<FeatureValue>(b => builder.Entity<FeatureValue>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "FeatureValues"; b.CollectionName = FeatureManagementDbProperties.DbTablePrefix + "FeatureValues";
}); });
} }
} }

15
modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoModelBuilderConfigurationOptions.cs

@ -1,15 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.Abp.FeatureManagement.MongoDB
{
public class FeatureManagementMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public FeatureManagementMongoModelBuilderConfigurationOptions(
[NotNull] string collectionPrefix = "")
: base(collectionPrefix)
{
}
}
}

4
modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/ProfileAppService.cs

@ -39,6 +39,8 @@ namespace Volo.Abp.Identity
var user = await UserManager.GetByIdAsync(CurrentUser.GetId()); var user = await UserManager.GetByIdAsync(CurrentUser.GetId());
user.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp);
if (!string.Equals(user.UserName, input.UserName, StringComparison.InvariantCultureIgnoreCase)) if (!string.Equals(user.UserName, input.UserName, StringComparison.InvariantCultureIgnoreCase))
{ {
if (await SettingProvider.IsTrueAsync(IdentitySettingNames.User.IsUserNameUpdateEnabled)) if (await SettingProvider.IsTrueAsync(IdentitySettingNames.User.IsUserNameUpdateEnabled))
@ -63,8 +65,6 @@ namespace Volo.Abp.Identity
user.Name = input.Name; user.Name = input.Name;
user.Surname = input.Surname; user.Surname = input.Surname;
user.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp);
input.MapExtraPropertiesTo(user); input.MapExtraPropertiesTo(user);
(await UserManager.UpdateAsync(user)).CheckErrors(); (await UserManager.UpdateAsync(user)).CheckErrors();

83
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs

@ -1,5 +1,4 @@
using System; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.Modeling;
using Volo.Abp.IdentityServer.ApiResources; using Volo.Abp.IdentityServer.ApiResources;
@ -14,8 +13,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
public static class IdentityServerDbContextModelCreatingExtensions public static class IdentityServerDbContextModelCreatingExtensions
{ {
public static void ConfigureIdentityServer( public static void ConfigureIdentityServer(
this ModelBuilder builder, this ModelBuilder builder)
Action<IdentityServerModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
@ -24,18 +22,11 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
return; return;
} }
var options = new IdentityServerModelBuilderConfigurationOptions(
AbpIdentityServerDbProperties.DbTablePrefix,
AbpIdentityServerDbProperties.DbSchema
);
optionsAction?.Invoke(options);
#region Client #region Client
builder.Entity<Client>(b => builder.Entity<Client>(b =>
{ {
b.ToTable(options.TablePrefix + "Clients", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "Clients", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -69,7 +60,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientGrantType>(b => builder.Entity<ClientGrantType>(b =>
{ {
b.ToTable(options.TablePrefix + "ClientGrantTypes", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientGrantTypes", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -82,13 +73,13 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientRedirectUri>(b => builder.Entity<ClientRedirectUri>(b =>
{ {
b.ToTable(options.TablePrefix + "ClientRedirectUris", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientRedirectUris", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.HasKey(x => new {x.ClientId, x.RedirectUri}); b.HasKey(x => new {x.ClientId, x.RedirectUri});
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql)) if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql))
{ {
ClientRedirectUriConsts.RedirectUriMaxLengthValue = 300; ClientRedirectUriConsts.RedirectUriMaxLengthValue = 300;
} }
@ -100,13 +91,13 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientPostLogoutRedirectUri>(b => builder.Entity<ClientPostLogoutRedirectUri>(b =>
{ {
b.ToTable(options.TablePrefix + "ClientPostLogoutRedirectUris", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientPostLogoutRedirectUris", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.HasKey(x => new {x.ClientId, x.PostLogoutRedirectUri}); b.HasKey(x => new {x.ClientId, x.PostLogoutRedirectUri});
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql)) if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql))
{ {
ClientPostLogoutRedirectUriConsts.PostLogoutRedirectUriMaxLengthValue = 300; ClientPostLogoutRedirectUriConsts.PostLogoutRedirectUriMaxLengthValue = 300;
} }
@ -120,7 +111,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientScope>(b => builder.Entity<ClientScope>(b =>
{ {
b.ToTable(options.TablePrefix + "ClientScopes", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientScopes", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -133,14 +124,14 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientSecret>(b => builder.Entity<ClientSecret>(b =>
{ {
b.ToTable(options.TablePrefix + "ClientSecrets", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientSecrets", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.HasKey(x => new {x.ClientId, x.Type, x.Value}); b.HasKey(x => new {x.ClientId, x.Type, x.Value});
b.Property(x => x.Type).HasMaxLength(ClientSecretConsts.TypeMaxLength).IsRequired(); b.Property(x => x.Type).HasMaxLength(ClientSecretConsts.TypeMaxLength).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
{ {
ClientSecretConsts.ValueMaxLength = 300; ClientSecretConsts.ValueMaxLength = 300;
} }
@ -152,7 +143,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientClaim>(b => builder.Entity<ClientClaim>(b =>
{ {
b.ToTable(options.TablePrefix + "ClientClaims", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientClaims", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -166,7 +157,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientIdPRestriction>(b => builder.Entity<ClientIdPRestriction>(b =>
{ {
b.ToTable(options.TablePrefix + "ClientIdPRestrictions", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientIdPRestrictions", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -179,7 +170,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientCorsOrigin>(b => builder.Entity<ClientCorsOrigin>(b =>
{ {
b.ToTable(options.TablePrefix + "ClientCorsOrigins", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientCorsOrigins", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -192,14 +183,14 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ClientProperty>(b => builder.Entity<ClientProperty>(b =>
{ {
b.ToTable(options.TablePrefix + "ClientProperties", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ClientProperties", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.HasKey(x => new {x.ClientId, x.Key, x.Value}); b.HasKey(x => new {x.ClientId, x.Key, x.Value});
b.Property(x => x.Key).HasMaxLength(ClientPropertyConsts.KeyMaxLength).IsRequired(); b.Property(x => x.Key).HasMaxLength(ClientPropertyConsts.KeyMaxLength).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql)) if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql))
{ {
ClientPropertyConsts.ValueMaxLength = 300; ClientPropertyConsts.ValueMaxLength = 300;
} }
@ -214,7 +205,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<IdentityResource>(b => builder.Entity<IdentityResource>(b =>
{ {
b.ToTable(options.TablePrefix + "IdentityResources", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "IdentityResources", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -230,7 +221,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<IdentityResourceClaim>(b => builder.Entity<IdentityResourceClaim>(b =>
{ {
b.ToTable(options.TablePrefix + "IdentityResourceClaims", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "IdentityResourceClaims", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -243,14 +234,14 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<IdentityResourceProperty>(b => builder.Entity<IdentityResourceProperty>(b =>
{ {
b.ToTable(options.TablePrefix + "IdentityResourceProperties", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "IdentityResourceProperties", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.HasKey(x => new {x.IdentityResourceId, x.Key, x.Value}); b.HasKey(x => new {x.IdentityResourceId, x.Key, x.Value});
b.Property(x => x.Key).HasMaxLength(IdentityResourcePropertyConsts.KeyMaxLength).IsRequired(); b.Property(x => x.Key).HasMaxLength(IdentityResourcePropertyConsts.KeyMaxLength).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
{ {
IdentityResourcePropertyConsts.ValueMaxLength = 300; IdentityResourcePropertyConsts.ValueMaxLength = 300;
} }
@ -265,7 +256,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiResource>(b => builder.Entity<ApiResource>(b =>
{ {
b.ToTable(options.TablePrefix + "ApiResources", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResources", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -284,7 +275,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiResourceSecret>(b => builder.Entity<ApiResourceSecret>(b =>
{ {
b.ToTable(options.TablePrefix + "ApiResourceSecrets", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResourceSecrets", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -292,7 +283,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
b.Property(x => x.Type).HasMaxLength(ApiResourceSecretConsts.TypeMaxLength).IsRequired(); b.Property(x => x.Type).HasMaxLength(ApiResourceSecretConsts.TypeMaxLength).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
{ {
ApiResourceSecretConsts.ValueMaxLength = 300; ApiResourceSecretConsts.ValueMaxLength = 300;
} }
@ -305,7 +296,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiResourceClaim>(b => builder.Entity<ApiResourceClaim>(b =>
{ {
b.ToTable(options.TablePrefix + "ApiResourceClaims", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResourceClaims", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -318,7 +309,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiResourceScope>(b => builder.Entity<ApiResourceScope>(b =>
{ {
b.ToTable(options.TablePrefix + "ApiResourceScopes", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResourceScopes", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -331,14 +322,14 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiResourceProperty>(b => builder.Entity<ApiResourceProperty>(b =>
{ {
b.ToTable(options.TablePrefix + "ApiResourceProperties", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiResourceProperties", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.HasKey(x => new {x.ApiResourceId, x.Key, x.Value}); b.HasKey(x => new {x.ApiResourceId, x.Key, x.Value});
b.Property(x => x.Key).HasMaxLength(ApiResourcePropertyConsts.KeyMaxLength).IsRequired(); b.Property(x => x.Key).HasMaxLength(ApiResourcePropertyConsts.KeyMaxLength).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
{ {
ApiResourcePropertyConsts.ValueMaxLength = 300; ApiResourcePropertyConsts.ValueMaxLength = 300;
} }
@ -353,7 +344,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiScope>(b => builder.Entity<ApiScope>(b =>
{ {
b.ToTable(options.TablePrefix + "ApiScopes", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiScopes", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -369,7 +360,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiScopeClaim>(b => builder.Entity<ApiScopeClaim>(b =>
{ {
b.ToTable(options.TablePrefix + "ApiScopeClaims", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiScopeClaims", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -382,14 +373,14 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<ApiScopeProperty>(b => builder.Entity<ApiScopeProperty>(b =>
{ {
b.ToTable(options.TablePrefix + "ApiScopeProperties", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "ApiScopeProperties", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.HasKey(x => new {x.ApiScopeId, x.Key, x.Value}); b.HasKey(x => new {x.ApiScopeId, x.Key, x.Value});
b.Property(x => x.Key).HasMaxLength(ApiScopePropertyConsts.KeyMaxLength).IsRequired(); b.Property(x => x.Key).HasMaxLength(ApiScopePropertyConsts.KeyMaxLength).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
{ {
ApiScopePropertyConsts.ValueMaxLength = 300; ApiScopePropertyConsts.ValueMaxLength = 300;
} }
@ -404,7 +395,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<PersistedGrant>(b => builder.Entity<PersistedGrant>(b =>
{ {
b.ToTable(options.TablePrefix + "PersistedGrants", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "PersistedGrants", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -416,7 +407,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
b.Property(x => x.Description).HasMaxLength(PersistedGrantConsts.DescriptionMaxLength); b.Property(x => x.Description).HasMaxLength(PersistedGrantConsts.DescriptionMaxLength);
b.Property(x => x.CreationTime).IsRequired(); b.Property(x => x.CreationTime).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql)) if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql))
{ {
PersistedGrantConsts.DataMaxLengthValue = 10000; //TODO: MySQL accepts 20.000. We can consider to change in v3.0. PersistedGrantConsts.DataMaxLengthValue = 10000; //TODO: MySQL accepts 20.000. We can consider to change in v3.0.
} }
@ -438,7 +429,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
builder.Entity<DeviceFlowCodes>(b => builder.Entity<DeviceFlowCodes>(b =>
{ {
b.ToTable(options.TablePrefix + "DeviceFlowCodes", options.Schema); b.ToTable(AbpIdentityServerDbProperties.DbTablePrefix + "DeviceFlowCodes", AbpIdentityServerDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();
@ -451,7 +442,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
b.Property(x => x.CreationTime).IsRequired(); b.Property(x => x.CreationTime).IsRequired();
b.Property(x => x.Expiration).IsRequired(); b.Property(x => x.Expiration).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql)) if (IsDatabaseProvider(builder, EfCoreDatabaseProvider.MySql))
{ {
DeviceFlowCodesConsts.DataMaxLength = 10000; //TODO: MySQL accepts 20.000. We can consider to change in v3.0. DeviceFlowCodesConsts.DataMaxLength = 10000; //TODO: MySQL accepts 20.000. We can consider to change in v3.0.
} }
@ -471,13 +462,11 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
private static bool IsDatabaseProvider( private static bool IsDatabaseProvider(
ModelBuilder modelBuilder, ModelBuilder modelBuilder,
IdentityServerModelBuilderConfigurationOptions options,
params EfCoreDatabaseProvider[] providers) params EfCoreDatabaseProvider[] providers)
{ {
foreach (var provider in providers) foreach (var provider in providers)
{ {
if (options.DatabaseProvider == EfCoreDatabaseProvider.MySql || if (modelBuilder.GetDatabaseProvider() == provider)
modelBuilder.GetDatabaseProvider() == provider)
{ {
return true; return true;
} }

23
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerModelBuilderConfigurationOptions.cs

@ -1,23 +0,0 @@
using System;
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.IdentityServer.EntityFrameworkCore
{
public class IdentityServerModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
[Obsolete("No need to manually set database provider after v2.9+. If it doesn't set automatically, use modelBuilder.UseXXX() in the OnModelCreating method of your DbContext (XXX is your database provider name).")]
public EfCoreDatabaseProvider? DatabaseProvider { get; set; }
public IdentityServerModelBuilderConfigurationOptions(
[NotNull] string tablePrefix,
[CanBeNull] string schema)
: base(
tablePrefix,
schema)
{
}
}
}

24
modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/AbpIdentityServerMongoDbContextExtensions.cs

@ -1,5 +1,4 @@
using System; using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.ApiScopes; using Volo.Abp.IdentityServer.ApiScopes;
using Volo.Abp.IdentityServer.Clients; using Volo.Abp.IdentityServer.Clients;
using Volo.Abp.IdentityServer.Devices; using Volo.Abp.IdentityServer.Devices;
@ -12,45 +11,38 @@ namespace Volo.Abp.IdentityServer.MongoDB
public static class AbpIdentityServerMongoDbContextExtensions public static class AbpIdentityServerMongoDbContextExtensions
{ {
public static void ConfigureIdentityServer( public static void ConfigureIdentityServer(
this IMongoModelBuilder builder, this IMongoModelBuilder builder)
Action<IdentityServerMongoModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new IdentityServerMongoModelBuilderConfigurationOptions(
AbpIdentityServerDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<ApiResource>(b => builder.Entity<ApiResource>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "ApiResources"; b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "ApiResources";
}); });
builder.Entity<ApiScope>(b => builder.Entity<ApiScope>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "ApiScopes"; b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "ApiScopes";
}); });
builder.Entity<IdentityResource>(b => builder.Entity<IdentityResource>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "IdentityResources"; b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "IdentityResources";
}); });
builder.Entity<Client>(b => builder.Entity<Client>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "Clients"; b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "Clients";
}); });
builder.Entity<PersistedGrant>(b => builder.Entity<PersistedGrant>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "PersistedGrants"; b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "PersistedGrants";
}); });
builder.Entity<DeviceFlowCodes>(b => builder.Entity<DeviceFlowCodes>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "DeviceFlowCodes"; b.CollectionName = AbpIdentityServerDbProperties.DbTablePrefix + "DeviceFlowCodes";
}); });
} }
} }

13
modules/identityserver/src/Volo.Abp.IdentityServer.MongoDB/Volo/Abp/IdentityServer/MongoDB/IdentityServerMongoModelBuilderConfigurationOptions.cs

@ -1,13 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.Abp.IdentityServer.MongoDB
{
public class IdentityServerMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public IdentityServerMongoModelBuilderConfigurationOptions([NotNull] string collectionPrefix = "")
: base(collectionPrefix)
{
}
}
}

15
modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementDbContextModelBuilderExtensions.cs

@ -1,5 +1,4 @@
using System; using JetBrains.Annotations;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.Modeling;
@ -8,21 +7,13 @@ namespace Volo.Abp.PermissionManagement.EntityFrameworkCore
public static class AbpPermissionManagementDbContextModelBuilderExtensions public static class AbpPermissionManagementDbContextModelBuilderExtensions
{ {
public static void ConfigurePermissionManagement( public static void ConfigurePermissionManagement(
[NotNull] this ModelBuilder builder, [NotNull] this ModelBuilder builder)
[CanBeNull] Action<AbpPermissionManagementModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new AbpPermissionManagementModelBuilderConfigurationOptions(
AbpPermissionManagementDbProperties.DbTablePrefix,
AbpPermissionManagementDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<PermissionGrant>(b => builder.Entity<PermissionGrant>(b =>
{ {
b.ToTable(options.TablePrefix + "PermissionGrants", options.Schema); b.ToTable(AbpPermissionManagementDbProperties.DbTablePrefix + "PermissionGrants", AbpPermissionManagementDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();

18
modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementModelBuilderConfigurationOptions.cs

@ -1,18 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.PermissionManagement.EntityFrameworkCore
{
public class AbpPermissionManagementModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public AbpPermissionManagementModelBuilderConfigurationOptions(
[NotNull] string tablePrefix,
[CanBeNull] string schema)
: base(
tablePrefix,
schema)
{
}
}
}

14
modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbContextExtensions.cs

@ -1,25 +1,17 @@
using System; using Volo.Abp.MongoDB;
using Volo.Abp.MongoDB;
namespace Volo.Abp.PermissionManagement.MongoDB namespace Volo.Abp.PermissionManagement.MongoDB
{ {
public static class AbpPermissionManagementMongoDbContextExtensions public static class AbpPermissionManagementMongoDbContextExtensions
{ {
public static void ConfigurePermissionManagement( public static void ConfigurePermissionManagement(
this IMongoModelBuilder builder, this IMongoModelBuilder builder)
Action<AbpMongoModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new PermissionManagementMongoModelBuilderConfigurationOptions(
AbpPermissionManagementDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options);
builder.Entity<PermissionGrant>(b => builder.Entity<PermissionGrant>(b =>
{ {
b.CollectionName = options.CollectionPrefix + "PermissionGrants"; b.CollectionName = AbpPermissionManagementDbProperties.DbTablePrefix + "PermissionGrants";
}); });
} }
} }

14
modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/PermissionManagementMongoModelBuilderConfigurationOptions.cs

@ -1,14 +0,0 @@
using JetBrains.Annotations;
using Volo.Abp.MongoDB;
namespace Volo.Abp.PermissionManagement.MongoDB
{
public class PermissionManagementMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions
{
public PermissionManagementMongoModelBuilderConfigurationOptions(
[NotNull] string tablePrefix = "")
: base(tablePrefix)
{
}
}
}

2
modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml

@ -24,7 +24,7 @@
<abp-tab title="@group.DisplayName" name="v-pills-tab-@group.GetNormalizedGroupName()"> <abp-tab title="@group.DisplayName" name="v-pills-tab-@group.GetNormalizedGroupName()">
<h4>@group.DisplayName</h4> <h4>@group.DisplayName</h4>
<hr class="mt-2 mb-3"/> <hr class="mt-2 mb-3"/>
<div class="custom-scroll-content"> <div class="w-100" style="max-height: 640px;overflow-y: auto">
<div class="pl-1 pt-1"> <div class="pl-1 pt-1">
<abp-input asp-for="@group.IsAllPermissionsGranted" <abp-input asp-for="@group.IsAllPermissionsGranted"
check-box-hidden-input-render-mode="None" check-box-hidden-input-render-mode="None"

5
modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/DemoAppModule.cs

@ -21,6 +21,7 @@ using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement; using Volo.Abp.PermissionManagement;
using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.HttpApi;
using Volo.Abp.PermissionManagement.Identity; using Volo.Abp.PermissionManagement.Identity;
using Volo.Abp.SettingManagement.EntityFrameworkCore; using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.Web; using Volo.Abp.SettingManagement.Web;
@ -32,15 +33,19 @@ namespace Volo.Abp.SettingManagement.DemoApp
[DependsOn( [DependsOn(
typeof(AbpSettingManagementWebModule), typeof(AbpSettingManagementWebModule),
typeof(AbpSettingManagementApplicationModule), typeof(AbpSettingManagementApplicationModule),
typeof(AbpSettingManagementHttpApiModule),
typeof(AbpAutofacModule), typeof(AbpAutofacModule),
typeof(AbpAccountWebModule), typeof(AbpAccountWebModule),
typeof(AbpAccountApplicationModule), typeof(AbpAccountApplicationModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementApplicationModule), typeof(AbpPermissionManagementApplicationModule),
typeof(AbpPermissionManagementHttpApiModule),
typeof(AbpIdentityWebModule), typeof(AbpIdentityWebModule),
typeof(AbpIdentityApplicationModule), typeof(AbpIdentityApplicationModule),
typeof(AbpIdentityHttpApiModule),
typeof(AbpIdentityEntityFrameworkCoreModule), typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpPermissionManagementDomainIdentityModule), typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule) typeof(AbpAspNetCoreMvcUiBasicThemeModule)

4
modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/Volo.Abp.SettingManagement.DemoApp.csproj

@ -17,19 +17,23 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Volo.Abp.SettingManagement.Application\Volo.Abp.SettingManagement.Application.csproj" /> <ProjectReference Include="..\..\src\Volo.Abp.SettingManagement.Application\Volo.Abp.SettingManagement.Application.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.SettingManagement.HttpApi\Volo.Abp.SettingManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.SettingManagement.Web\Volo.Abp.SettingManagement.Web.csproj" /> <ProjectReference Include="..\..\src\Volo.Abp.SettingManagement.Web\Volo.Abp.SettingManagement.Web.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" /> <ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" /> <ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.Application\Volo.Abp.PermissionManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.HttpApi\Volo.Abp.PermissionManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.PermissionManagement.Domain.Identity\Volo.Abp.PermissionManagement.Domain.Identity.csproj" />
<ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" /> <ProjectReference Include="..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Application\Volo.Abp.Account.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.HttpApi\Volo.Abp.Account.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" /> <ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />
</ItemGroup> </ItemGroup>

3123
modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/wwwroot/libs/sweetalert2/sweetalert2.all.js

File diff suppressed because one or more lines are too long

2
modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/wwwroot/libs/sweetalert2/sweetalert2.all.min.js

File diff suppressed because one or more lines are too long

1319
modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/wwwroot/libs/sweetalert2/sweetalert2.css

File diff suppressed because it is too large

3121
modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/wwwroot/libs/sweetalert2/sweetalert2.js

File diff suppressed because it is too large

1
modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/wwwroot/libs/sweetalert2/sweetalert2.min.css

File diff suppressed because one or more lines are too long

1
modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/wwwroot/libs/sweetalert2/sweetalert2.min.js

File diff suppressed because one or more lines are too long

28
modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContextModelBuilderExtensions.cs

@ -1,29 +1,14 @@
using System; using JetBrains.Annotations;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Volo.Abp.SettingManagement.EntityFrameworkCore namespace Volo.Abp.SettingManagement.EntityFrameworkCore
{ {
public class SettingManagementModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions
{
public SettingManagementModelBuilderConfigurationOptions(
[NotNull] string tablePrefix,
[CanBeNull] string schema)
: base(
tablePrefix,
schema)
{
}
}
public static class SettingManagementDbContextModelBuilderExtensions public static class SettingManagementDbContextModelBuilderExtensions
{ {
//TODO: Instead of getting parameters, get a action of SettingManagementModelBuilderConfigurationOptions like other modules //TODO: Instead of getting parameters, get a action of SettingManagementModelBuilderConfigurationOptions like other modules
public static void ConfigureSettingManagement( public static void ConfigureSettingManagement(
[NotNull] this ModelBuilder builder, [NotNull] this ModelBuilder builder)
[CanBeNull] Action<SettingManagementModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
@ -32,16 +17,9 @@ namespace Volo.Abp.SettingManagement.EntityFrameworkCore
return; return;
} }
var options = new SettingManagementModelBuilderConfigurationOptions(
AbpSettingManagementDbProperties.DbTablePrefix,
AbpSettingManagementDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<Setting>(b => builder.Entity<Setting>(b =>
{ {
b.ToTable(options.TablePrefix + "Settings", options.Schema); b.ToTable(AbpSettingManagementDbProperties.DbTablePrefix + "Settings", AbpSettingManagementDbProperties.DbSchema);
b.ConfigureByConvention(); b.ConfigureByConvention();

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save