diff --git a/aspnet-core/LINGYUN.MicroService.Aspire.slnx b/aspnet-core/LINGYUN.MicroService.Aspire.slnx
index 5b8b57cbc..809d5d087 100644
--- a/aspnet-core/LINGYUN.MicroService.Aspire.slnx
+++ b/aspnet-core/LINGYUN.MicroService.Aspire.slnx
@@ -170,13 +170,6 @@
-
-
-
-
-
-
-
diff --git a/aspnet-core/LINGYUN.MicroService.SingleProject.slnx b/aspnet-core/LINGYUN.MicroService.SingleProject.slnx
index ee04e035f..da6c9a2ad 100644
--- a/aspnet-core/LINGYUN.MicroService.SingleProject.slnx
+++ b/aspnet-core/LINGYUN.MicroService.SingleProject.slnx
@@ -14,10 +14,6 @@
-
-
-
-
@@ -155,7 +151,6 @@
-
@@ -347,8 +342,6 @@
-
-
diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs
index a28332885..cecd70289 100644
--- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs
+++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs
@@ -1,5 +1,6 @@
using JetBrains.Annotations;
using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Logging.Abstractions;
using OpenIddict.Abstractions;
using System.Threading.Tasks;
using Volo.Abp.Data;
@@ -23,6 +24,8 @@ public class IdentityClaimTypeDataSeeder : ITransientDependency
GuidGenerator = guidGenerator;
IdentityClaimTypeManager = identityClaimTypeManager;
IdentityClaimTypeRepository = identityClaimTypeRepository;
+
+ Logger = NullLogger.Instance;
}
public async virtual Task SeedAsync(DataSeedContext context)
@@ -67,9 +70,9 @@ public class IdentityClaimTypeDataSeeder : ITransientDependency
[NotNull] string name,
bool required = false,
bool isStatic = false,
- [CanBeNull] string regex = null,
- [CanBeNull] string regexDescription = null,
- [CanBeNull] string description = null,
+ [CanBeNull] string? regex = null,
+ [CanBeNull] string? regexDescription = null,
+ [CanBeNull] string? description = null,
IdentityClaimValueType valueType = IdentityClaimValueType.String)
{
if (!await IdentityClaimTypeRepository.AnyAsync(name))
diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs
index 02f716a52..4c568f4bc 100644
--- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs
+++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs
@@ -55,7 +55,7 @@ public class IdentityUserRoleDataSeeder : ITransientDependency
await IdentityOptions.SetAsync();
const string adminRoleName = "admin";
- var adminUserName = context?[AdminUserNamePropertyName] as string ?? AdminUserNameDefaultValue;
+ var adminUserName = context[AdminUserNamePropertyName] as string ?? AdminUserNameDefaultValue;
Guid adminRoleId;
if (!await RoleManager.RoleExistsAsync(adminRoleName))
@@ -74,7 +74,7 @@ public class IdentityUserRoleDataSeeder : ITransientDependency
else
{
var adminRole = await RoleManager.FindByNameAsync(adminRoleName);
- adminRoleId = adminRole.Id;
+ adminRoleId = adminRole!.Id;
}
var adminUserId = GuidGenerator.Create();
@@ -83,8 +83,8 @@ public class IdentityUserRoleDataSeeder : ITransientDependency
{
adminUserId = adminUserGuid;
}
- var adminEmailAddress = context?[AdminEmailPropertyName] as string ?? AdminEmailDefaultValue;
- var adminPassword = context?[AdminPasswordPropertyName] as string ?? AdminPasswordDefaultValue;
+ var adminEmailAddress = context[AdminEmailPropertyName] as string ?? AdminEmailDefaultValue;
+ var adminPassword = context[AdminPasswordPropertyName] as string ?? AdminPasswordDefaultValue;
var adminUser = await UserManager.FindByNameAsync(adminUserName);
if (adminUser == null)
diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/DataSeeds/NotificationDataSeeder.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/DataSeeds/NotificationDataSeeder.cs
index bd9c2b459..59a2e1d4f 100644
--- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/DataSeeds/NotificationDataSeeder.cs
+++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/DataSeeds/NotificationDataSeeder.cs
@@ -100,7 +100,7 @@ public class NotificationDataSeeder : ITransientDependency
new NotificationTemplate(
TenantNotificationNames.NewTenantRegistered,
formUser: adminEmailAddress,
- data: new Dictionary
+ data: new Dictionary
{
{ "name", adminUserName },
{ "email", adminEmailAddress },
diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/LINGYUN.Abp.MicroService.MessageService.csproj b/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/LINGYUN.Abp.MicroService.MessageService.csproj
index a75d21285..278615940 100644
--- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/LINGYUN.Abp.MicroService.MessageService.csproj
+++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/LINGYUN.Abp.MicroService.MessageService.csproj
@@ -78,7 +78,6 @@
-
diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/MessageServiceModule.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/MessageServiceModule.cs
index 63da337c4..553806c7f 100644
--- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/MessageServiceModule.cs
+++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/MessageServiceModule.cs
@@ -3,7 +3,6 @@ using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Authorization.OrganizationUnits;
using LINGYUN.Abp.BackgroundTasks.DistributedLocking;
-using LINGYUN.Abp.BackgroundTasks.ExceptionHandling;
using LINGYUN.Abp.BackgroundTasks.Quartz;
using LINGYUN.Abp.Claims.Mapping;
using LINGYUN.Abp.Data.DbMigrator;
@@ -74,7 +73,6 @@ namespace LINGYUN.Abp.MicroService.MessageService;
typeof(AbpIdentityWeChatWorkModule),
typeof(AbpBackgroundTasksQuartzModule),
typeof(AbpBackgroundTasksDistributedLockingModule),
- typeof(AbpBackgroundTasksExceptionHandlingModule),
typeof(TaskManagementEntityFrameworkCoreModule),
typeof(AbpMessageServiceEntityFrameworkCoreModule),
typeof(AbpNotificationsEntityFrameworkCoreModule),
diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService.EntityFrameworkCore/TaskServiceDataSeeder.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService.EntityFrameworkCore/TaskServiceDataSeeder.cs
index 85af7f482..b9c73f4ad 100644
--- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService.EntityFrameworkCore/TaskServiceDataSeeder.cs
+++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService.EntityFrameworkCore/TaskServiceDataSeeder.cs
@@ -90,7 +90,7 @@ public class TaskServiceDataSeeder : ITransientDependency
Source = JobSource.System,
LockTimeOut = Options.JobFetchLockTimeOut,
TenantId = tenantId,
- Type = typeof(BackgroundPollingJob).AssemblyQualifiedName,
+ Type = typeof(BackgroundPollingJob).AssemblyQualifiedName!,
};
}
@@ -111,7 +111,7 @@ public class TaskServiceDataSeeder : ITransientDependency
Priority = JobPriority.High,
Source = JobSource.System,
TenantId = tenantId,
- Type = typeof(BackgroundCleaningJob).AssemblyQualifiedName,
+ Type = typeof(BackgroundCleaningJob).AssemblyQualifiedName!,
};
}
@@ -133,7 +133,7 @@ public class TaskServiceDataSeeder : ITransientDependency
Priority = JobPriority.High,
Source = JobSource.System,
TenantId = tenantId,
- Type = typeof(BackgroundCheckingJob).AssemblyQualifiedName,
+ Type = typeof(BackgroundCheckingJob).AssemblyQualifiedName!,
};
}
}
diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/LINGYUN.Abp.MicroService.WebhookService.csproj b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/LINGYUN.Abp.MicroService.WebhookService.csproj
index b3ddc7b15..b7c147c12 100644
--- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/LINGYUN.Abp.MicroService.WebhookService.csproj
+++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/LINGYUN.Abp.MicroService.WebhookService.csproj
@@ -64,7 +64,6 @@
-
diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/WebhookServiceModule.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/WebhookServiceModule.cs
index 902aabb14..581a35fae 100644
--- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/WebhookServiceModule.cs
+++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/WebhookServiceModule.cs
@@ -3,7 +3,6 @@ using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Authorization.OrganizationUnits;
using LINGYUN.Abp.BackgroundTasks.DistributedLocking;
-using LINGYUN.Abp.BackgroundTasks.ExceptionHandling;
using LINGYUN.Abp.BackgroundTasks.Quartz;
using LINGYUN.Abp.Claims.Mapping;
using LINGYUN.Abp.Dapr.Client.Wrapper;
@@ -46,7 +45,6 @@ namespace LINGYUN.Abp.MicroService.WebhookService;
typeof(AbpWebhooksEventBusModule),
typeof(AbpBackgroundTasksQuartzModule),
typeof(AbpBackgroundTasksDistributedLockingModule),
- typeof(AbpBackgroundTasksExceptionHandlingModule),
typeof(WebhookServiceMigrationsEntityFrameworkCoreModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpAuthorizationOrganizationUnitsModule),
diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj
index 3171e6528..6a8af9143 100644
--- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj
+++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj
@@ -12,7 +12,6 @@
-
@@ -74,7 +73,6 @@
-
diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs
index 686e785ad..7fe8f244e 100644
--- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs
+++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs
@@ -3,7 +3,6 @@ using Elsa;
using Elsa.Options;
using Elsa.Rebus.RabbitMq;
using LINGYUN.Abp.BackgroundTasks;
-using LINGYUN.Abp.BlobStoring.BlobManagement;
using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.LocalizationManagement;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
@@ -45,7 +44,6 @@ using Volo.Abp.Threading;
using Volo.Abp.Timing;
using Volo.Abp.VirtualFileSystem;
using ConsoleStartup = Elsa.Activities.Console.Startup;
-using EmailStartup = Elsa.Activities.Email.Startup;
using HttpStartup = Elsa.Activities.Http.Startup;
using JavaScriptStartup = Elsa.Scripting.JavaScript.Startup;
using TemporalQuartzStartup = Elsa.Activities.Temporal.Quartz.Startup;
@@ -150,7 +148,6 @@ public partial class WorkflowServiceModule
typeof(HttpStartup),
typeof(UserTaskStartup),
typeof(TemporalQuartzStartup),
- typeof(EmailStartup),
typeof(JavaScriptStartup),
typeof(WebhooksStartup),
};
diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs
index 97fe61542..830665db6 100644
--- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs
+++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs
@@ -3,7 +3,6 @@ using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Authorization.OrganizationUnits;
using LINGYUN.Abp.BackgroundTasks.DistributedLocking;
-using LINGYUN.Abp.BackgroundTasks.ExceptionHandling;
using LINGYUN.Abp.BackgroundTasks.Quartz;
using LINGYUN.Abp.BlobStoring.BlobManagement;
using LINGYUN.Abp.Claims.Mapping;
@@ -61,7 +60,6 @@ namespace LINGYUN.Abp.MicroService.WorkflowService;
typeof(AbpAspNetCoreMultiTenancyModule),
typeof(AbpBackgroundTasksQuartzModule),
typeof(AbpBackgroundTasksDistributedLockingModule),
- typeof(AbpBackgroundTasksExceptionHandlingModule),
typeof(AbpQuartzPostgresSqlInstallerModule),
typeof(TaskManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AuditLoggingIndexInitializer.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AuditLoggingIndexInitializer.cs
index cc269932f..e9571626c 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AuditLoggingIndexInitializer.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AuditLoggingIndexInitializer.cs
@@ -148,13 +148,13 @@ public class AuditLoggingIndexInitializer : IAuditLoggingIndexInitializer, ISing
if (!putTemplateResponse.IsValidResponse)
{
var errorBuilder = new StringBuilder();
- if (putTemplateResponse.TryGetOriginalException(out var ex))
+ if (putTemplateResponse.TryGetOriginalException(out var ex) && ex != null)
{
errorBuilder.AppendLine(ex.Message);
Logger.LogWarning(ex, "Failed to initialize index and audit log may not be retrieved.");
return;
}
- else if (putTemplateResponse.TryGetElasticsearchServerError(out var error))
+ else if (putTemplateResponse.TryGetElasticsearchServerError(out var error) && error != null)
{
errorBuilder.AppendLine(error.ToString());
}
@@ -220,13 +220,13 @@ public class AuditLoggingIndexInitializer : IAuditLoggingIndexInitializer, ISing
if (!putTemplateResponse.IsValidResponse)
{
var errorBuilder = new StringBuilder();
- if (putTemplateResponse.TryGetOriginalException(out var ex))
+ if (putTemplateResponse.TryGetOriginalException(out var ex) && ex != null)
{
errorBuilder.AppendLine(ex.Message);
Logger.LogWarning(ex, "Failed to initialize index and security log may not be retrieved.");
return;
}
- else if (putTemplateResponse.TryGetElasticsearchServerError(out var error))
+ else if (putTemplateResponse.TryGetElasticsearchServerError(out var error) && error != null)
{
errorBuilder.AppendLine(error.ToString());
}
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs
index bd5beee38..da5aa1dd0 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs
@@ -43,14 +43,14 @@ public class ElasticsearchAuditLogManager : IAuditLogManager, ITransientDependen
public async virtual Task GetCountAsync(
DateTime? startTime = null,
DateTime? endTime = null,
- string httpMethod = null,
- string url = null,
+ string? httpMethod = null,
+ string? url = null,
Guid? userId = null,
- string userName = null,
- string applicationName = null,
- string correlationId = null,
- string clientId = null,
- string clientIpAddress = null,
+ string? userName = null,
+ string? applicationName = null,
+ string? correlationId = null,
+ string? clientId = null,
+ string? clientIpAddress = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
bool? hasException = null,
@@ -87,19 +87,19 @@ public class ElasticsearchAuditLogManager : IAuditLogManager, ITransientDependen
}
public async virtual Task> GetListAsync(
- string sorting = null,
+ string? sorting = null,
int maxResultCount = 50,
int skipCount = 0,
DateTime? startTime = null,
DateTime? endTime = null,
- string httpMethod = null,
- string url = null,
+ string? httpMethod = null,
+ string? url = null,
Guid? userId = null,
- string userName = null,
- string applicationName = null,
- string correlationId = null,
- string clientId = null,
- string clientIpAddress = null,
+ string? userName = null,
+ string? applicationName = null,
+ string? correlationId = null,
+ string? clientId = null,
+ string? clientIpAddress = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
bool? hasException = null,
@@ -159,7 +159,7 @@ public class ElasticsearchAuditLogManager : IAuditLogManager, ITransientDependen
return searchResponse.Documents.ToList();
}
- public async virtual Task GetAsync(
+ public async virtual Task GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default)
@@ -212,14 +212,14 @@ public class ElasticsearchAuditLogManager : IAuditLogManager, ITransientDependen
protected virtual List BuildQueryDescriptor(
DateTime? startTime = null,
DateTime? endTime = null,
- string httpMethod = null,
- string url = null,
+ string? httpMethod = null,
+ string? url = null,
Guid? userId = null,
- string userName = null,
- string applicationName = null,
- string correlationId = null,
- string clientId = null,
- string clientIpAddress = null,
+ string? userName = null,
+ string? applicationName = null,
+ string? correlationId = null,
+ string? clientId = null,
+ string? clientIpAddress = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
bool? hasException = null,
@@ -346,7 +346,7 @@ public class ElasticsearchAuditLogManager : IAuditLogManager, ITransientDependen
};
protected virtual string GetField(string field)
{
- if (_fieldMaps.TryGetValue(field, out string mapField))
+ if (_fieldMaps.TryGetValue(field, out var mapField))
{
return _elasticsearchOptions.FieldCamelCase ? mapField.ToCamelCase() : mapField.ToPascalCase();
}
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogWriter.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogWriter.cs
index c88aa3d51..3e30cbf3a 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogWriter.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogWriter.cs
@@ -1,5 +1,6 @@
using Elastic.Clients.Elasticsearch;
using Elastic.Clients.Elasticsearch.Core.Bulk;
+using Elastic.Transport.Products.Elasticsearch;
using LINGYUN.Abp.Elasticsearch;
using Microsoft.Extensions.Logging;
using System;
@@ -46,7 +47,7 @@ public class ElasticsearchAuditLogWriter : IAuditLogWriter, ITransientDependency
if (!response.IsValidResponse)
{
_logger.LogWarning("Could not save the audit log object: " + Environment.NewLine + auditLog.ToString());
- if (response.TryGetOriginalException(out var ex))
+ if (response.TryGetOriginalException(out var ex) && ex != null)
{
_logger.LogWarning(ex, ex.Message);
}
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchEntityChangeStore.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchEntityChangeStore.cs
index 6d17c8dc4..2eb6844e5 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchEntityChangeStore.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchEntityChangeStore.cs
@@ -39,7 +39,7 @@ public class ElasticsearchEntityChangeStore : IEntityChangeStore, ITransientDepe
Logger = NullLogger.Instance;
}
- public async virtual Task GetAsync(
+ public async virtual Task GetAsync(
Guid entityChangeId,
CancellationToken cancellationToken = default)
{
@@ -89,8 +89,8 @@ public class ElasticsearchEntityChangeStore : IEntityChangeStore, ITransientDepe
DateTime? startTime = null,
DateTime? endTime = null,
EntityChangeType? changeType = null,
- string entityId = null,
- string entityTypeFullName = null,
+ string? entityId = null,
+ string? entityTypeFullName = null,
CancellationToken cancellationToken = default)
{
var client = _clientFactory.Create();
@@ -127,15 +127,15 @@ public class ElasticsearchEntityChangeStore : IEntityChangeStore, ITransientDepe
}
public async virtual Task> GetListAsync(
- string sorting = null,
+ string? sorting = null,
int maxResultCount = 50,
int skipCount = 0,
Guid? auditLogId = null,
DateTime? startTime = null,
DateTime? endTime = null,
EntityChangeType? changeType = null,
- string entityId = null,
- string entityTypeFullName = null,
+ string? entityId = null,
+ string? entityTypeFullName = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
@@ -204,7 +204,7 @@ public class ElasticsearchEntityChangeStore : IEntityChangeStore, ITransientDepe
.ToList();
}
- public async virtual Task GetWithUsernameAsync(
+ public async virtual Task GetWithUsernameAsync(
Guid entityChangeId,
CancellationToken cancellationToken = default)
{
@@ -288,7 +288,7 @@ public class ElasticsearchEntityChangeStore : IEntityChangeStore, ITransientDepe
foreach (var entityChanges in entityChangesList)
{
- foreach (var entityChange in entityChanges.Where(e => e.EntityId.Equals(entityId) && e.EntityTypeFullName.Equals(entityTypeFullName)))
+ foreach (var entityChange in entityChanges.Where(e => string.Equals(e.EntityId, entityId) && string.Equals(e.EntityTypeFullName, entityTypeFullName)))
{
result.Add(
new EntityChangeWithUsername
@@ -309,8 +309,8 @@ public class ElasticsearchEntityChangeStore : IEntityChangeStore, ITransientDepe
DateTime? startTime = null,
DateTime? endTime = null,
EntityChangeType? changeType = null,
- string entityId = null,
- string entityTypeFullName = null,
+ string? entityId = null,
+ string? entityTypeFullName = null,
Guid? entityChangeId = null)
{
var queries = new List();
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs
index 5a5a72930..505f0e238 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs
@@ -38,7 +38,7 @@ public class ElasticsearchSecurityLogManager : ISecurityLogManager, ITransientDe
Logger = NullLogger.Instance;
}
- public async virtual Task GetAsync(
+ public async virtual Task GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default)
@@ -80,19 +80,19 @@ public class ElasticsearchSecurityLogManager : ISecurityLogManager, ITransientDe
}
public async virtual Task> GetListAsync(
- string sorting = null,
+ string? sorting = null,
int maxResultCount = 50,
int skipCount = 0,
DateTime? startTime = null,
DateTime? endTime = null,
- string applicationName = null,
- string identity = null,
- string action = null,
+ string? applicationName = null,
+ string? identity = null,
+ string? action = null,
Guid? userId = null,
- string userName = null,
- string clientId = null,
- string clientIpAddress = null,
- string correlationId = null,
+ string? userName = null,
+ string? clientId = null,
+ string? clientIpAddress = null,
+ string? correlationId = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
@@ -134,14 +134,14 @@ public class ElasticsearchSecurityLogManager : ISecurityLogManager, ITransientDe
public async virtual Task GetCountAsync(
DateTime? startTime = null,
DateTime? endTime = null,
- string applicationName = null,
- string identity = null,
- string action = null,
+ string? applicationName = null,
+ string? identity = null,
+ string? action = null,
Guid? userId = null,
- string userName = null,
- string clientId = null,
- string clientIpAddress = null,
- string correlationId = null,
+ string? userName = null,
+ string? clientId = null,
+ string? clientIpAddress = null,
+ string? correlationId = null,
CancellationToken cancellationToken = default)
{
var client = _clientFactory.Create();
@@ -172,14 +172,14 @@ public class ElasticsearchSecurityLogManager : ISecurityLogManager, ITransientDe
protected virtual List BuildQueryDescriptor(
DateTime? startTime = null,
DateTime? endTime = null,
- string applicationName = null,
- string identity = null,
- string action = null,
+ string? applicationName = null,
+ string? identity = null,
+ string? action = null,
Guid? userId = null,
- string userName = null,
- string clientId = null,
- string clientIpAddress = null,
- string correlationId = null)
+ string? userName = null,
+ string? clientId = null,
+ string? clientIpAddress = null,
+ string? correlationId = null)
{
var queries = new List();
@@ -256,7 +256,7 @@ public class ElasticsearchSecurityLogManager : ISecurityLogManager, ITransientDe
};
protected virtual string GetField(string field)
{
- if (_fieldMaps.TryGetValue(field, out string mapField))
+ if (_fieldMaps.TryGetValue(field, out var mapField))
{
return _elasticsearchOptions.FieldCamelCase ? mapField.ToCamelCase() : mapField.ToPascalCase();
}
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogWriter.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogWriter.cs
index 20f9e56b0..fc087a511 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogWriter.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogWriter.cs
@@ -51,7 +51,7 @@ public class ElasticsearchSecurityLogWriter : ISecurityLogWriter, ITransientDepe
if (!response.IsValidResponse)
{
_logger.LogWarning("Could not save the security log object: " + Environment.NewLine + securityLog.ToString());
- if (response.TryGetOriginalException(out var ex))
+ if (response.TryGetOriginalException(out var ex) && ex != null)
{
_logger.LogWarning(ex, ex.Message);
}
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AuditLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AuditLogManager.cs
index c803e4525..28cad7b10 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AuditLogManager.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AuditLogManager.cs
@@ -31,14 +31,14 @@ public class AuditLogManager : IAuditLogManager, ITransientDependency
public async virtual Task GetCountAsync(
DateTime? startTime = null,
DateTime? endTime = null,
- string httpMethod = null,
- string url = null,
+ string? httpMethod = null,
+ string? url = null,
Guid? userId = null,
- string userName = null,
- string applicationName = null,
- string correlationId = null,
- string clientId = null,
- string clientIpAddress = null,
+ string? userName = null,
+ string? applicationName = null,
+ string? correlationId = null,
+ string? clientId = null,
+ string? clientIpAddress = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
bool? hasException = null,
@@ -64,19 +64,19 @@ public class AuditLogManager : IAuditLogManager, ITransientDependency
}
public async virtual Task> GetListAsync(
- string sorting = null,
+ string? sorting = null,
int maxResultCount = 50,
int skipCount = 0,
DateTime? startTime = null,
DateTime? endTime = null,
- string httpMethod = null,
- string url = null,
+ string? httpMethod = null,
+ string? url = null,
Guid? userId = null,
- string userName = null,
- string applicationName = null,
- string correlationId = null,
- string clientId = null,
- string clientIpAddress = null,
+ string? userName = null,
+ string? applicationName = null,
+ string? correlationId = null,
+ string? clientId = null,
+ string? clientIpAddress = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
bool? hasException = null,
@@ -108,7 +108,7 @@ public class AuditLogManager : IAuditLogManager, ITransientDependency
return ObjectMapper.Map, List>(auditLogs);
}
- public async virtual Task GetAsync(
+ public async virtual Task GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default)
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/EntityChangeStore.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/EntityChangeStore.cs
index 948dbe0ad..e6e99d5d9 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/EntityChangeStore.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/EntityChangeStore.cs
@@ -30,7 +30,7 @@ public class EntityChangeStore : IEntityChangeStore, ITransientDependency
}
- public async virtual Task GetAsync(
+ public async virtual Task GetAsync(
Guid entityChangeId,
CancellationToken cancellationToken = default)
{
@@ -46,8 +46,8 @@ public class EntityChangeStore : IEntityChangeStore, ITransientDependency
DateTime? startTime = null,
DateTime? endTime = null,
EntityChangeType? changeType = null,
- string entityId = null,
- string entityTypeFullName = null,
+ string? entityId = null,
+ string? entityTypeFullName = null,
CancellationToken cancellationToken = default)
{
return await AuditLogRepository.GetEntityChangeCountAsync(
@@ -61,15 +61,15 @@ public class EntityChangeStore : IEntityChangeStore, ITransientDependency
}
public async virtual Task> GetListAsync(
- string sorting = null,
+ string? sorting = null,
int maxResultCount = 50,
int skipCount = 0,
Guid? auditLogId = null,
DateTime? startTime = null,
DateTime? endTime = null,
EntityChangeType? changeType = null,
- string entityId = null,
- string entityTypeFullName = null,
+ string? entityId = null,
+ string? entityTypeFullName = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
@@ -89,7 +89,7 @@ public class EntityChangeStore : IEntityChangeStore, ITransientDependency
return ObjectMapper.Map, List>(entityChanges);
}
- public async virtual Task GetWithUsernameAsync(
+ public async virtual Task GetWithUsernameAsync(
Guid entityChangeId,
CancellationToken cancellationToken = default)
{
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/SecurityLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/SecurityLogManager.cs
index 00df36963..c3b94df0e 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/SecurityLogManager.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/SecurityLogManager.cs
@@ -36,7 +36,7 @@ public class SecurityLogManager : ISecurityLogManager, ITransientDependency
}
}
- public async virtual Task GetAsync(
+ public async virtual Task GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default)
@@ -56,19 +56,19 @@ public class SecurityLogManager : ISecurityLogManager, ITransientDependency
}
public async virtual Task> GetListAsync(
- string sorting = null,
+ string? sorting = null,
int maxResultCount = 50,
int skipCount = 0,
DateTime? startTime = null,
DateTime? endTime = null,
- string applicationName = null,
- string identity = null,
- string action = null,
+ string? applicationName = null,
+ string? identity = null,
+ string? action = null,
Guid? userId = null,
- string userName = null,
- string clientId = null,
- string clientIpAddress = null,
- string correlationId = null,
+ string? userName = null,
+ string? clientId = null,
+ string? clientIpAddress = null,
+ string? correlationId = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
@@ -96,14 +96,14 @@ public class SecurityLogManager : ISecurityLogManager, ITransientDependency
public async virtual Task GetCountAsync(
DateTime? startTime = null,
DateTime? endTime = null,
- string applicationName = null,
- string identity = null,
- string action = null,
+ string? applicationName = null,
+ string? identity = null,
+ string? action = null,
Guid? userId = null,
- string userName = null,
- string clientId = null,
- string clientIpAddress = null,
- string correlationId = null,
+ string? userName = null,
+ string? clientId = null,
+ string? clientIpAddress = null,
+ string? correlationId = null,
CancellationToken cancellationToken = default)
{
return await IdentitySecurityLogRepository.GetCountAsync(
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLogAction.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLogAction.cs
index 9e4d402b5..6a82dc0bf 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLogAction.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLogAction.cs
@@ -13,11 +13,11 @@ public class AuditLogAction : IHasExtraProperties
public Guid AuditLogId { get; set; }
- public string ServiceName { get; set; }
+ public string ServiceName { get; set; } = default!;
- public string MethodName { get; set; }
+ public string MethodName { get; set; } = default!;
- public string Parameters { get; set; }
+ public string Parameters { get; set; } = default!;
public DateTime ExecutionTime { get; set; }
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLoggingQueue.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLoggingQueue.cs
index 3b615f6f2..bf1e6b013 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLoggingQueue.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLoggingQueue.cs
@@ -14,7 +14,7 @@ public abstract class AuditLoggingQueue
private readonly int _batchSize;
private readonly int _maxConcurrency;
- private volatile Task _consumerTask;
+ private volatile Task? _consumerTask;
private readonly SemaphoreSlim _flushSemaphore;
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
protected AuditLoggingQueue(
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultAuditLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultAuditLogManager.cs
index ca4e70eca..e2efa0d7d 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultAuditLogManager.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultAuditLogManager.cs
@@ -76,7 +76,7 @@ public class DefaultAuditLogManager : IAuditLogManager, ISingletonDependency
return Task.FromResult("");
}
- public virtual Task GetAsync(
+ public virtual Task GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default)
@@ -84,7 +84,7 @@ public class DefaultAuditLogManager : IAuditLogManager, ISingletonDependency
Logger.LogDebug("No audit log manager is available!");
AuditLog? auditLog = null;
- return Task.FromResult(auditLog!);
+ return Task.FromResult(auditLog);
}
public virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default)
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultEntityChangeStore.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultEntityChangeStore.cs
index 31c13577d..734e1dc60 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultEntityChangeStore.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultEntityChangeStore.cs
@@ -44,10 +44,10 @@ public class DefaultEntityChangeStore : IEntityChangeStore, ISingletonDependency
return Task.FromResult(new List());
}
- public Task GetWithUsernameAsync(Guid entityChangeId, CancellationToken cancellationToken = default)
+ public Task GetWithUsernameAsync(Guid entityChangeId, CancellationToken cancellationToken = default)
{
EntityChangeWithUsername? entityChange = null;
- return Task.FromResult(entityChange!);
+ return Task.FromResult(entityChange);
}
public Task> GetWithUsernameAsync(string entityId, string entityTypeFullName, CancellationToken cancellationToken = default)
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultSecurityLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultSecurityLogManager.cs
index e71547840..a6cbe53ec 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultSecurityLogManager.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultSecurityLogManager.cs
@@ -67,7 +67,7 @@ public class DefaultSecurityLogManager : ISecurityLogManager, ISingletonDependen
return Task.CompletedTask;
}
- public virtual Task GetAsync(
+ public virtual Task GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default)
@@ -75,7 +75,7 @@ public class DefaultSecurityLogManager : ISecurityLogManager, ISingletonDependen
Logger.LogDebug("No security log manager is available!");
SecurityLog? securityLog = null;
- return Task.FromResult(securityLog!);
+ return Task.FromResult(securityLog);
}
public virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default)
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChangeWithUsername.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChangeWithUsername.cs
index 0b16aa28b..c554fa617 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChangeWithUsername.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChangeWithUsername.cs
@@ -2,7 +2,7 @@
public class EntityChangeWithUsername
{
- public EntityChange EntityChange { get; set; }
+ public EntityChange EntityChange { get; set; } = default!;
- public string UserName { get; set; }
+ public string? UserName { get; set; }
}
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityPropertyChange.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityPropertyChange.cs
index 47015060a..bf2a88dac 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityPropertyChange.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityPropertyChange.cs
@@ -17,9 +17,9 @@ public class EntityPropertyChange
public string? OriginalValue { get; set; }
- public string PropertyName { get; set; }
+ public string PropertyName { get; set; } = default!;
- public string PropertyTypeFullName { get; set; }
+ public string PropertyTypeFullName { get; set; } = default!;
public EntityPropertyChange()
{
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IAuditLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IAuditLogManager.cs
index f689a463b..d0838ad6b 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IAuditLogManager.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IAuditLogManager.cs
@@ -8,7 +8,7 @@ namespace LINGYUN.Abp.AuditLogging;
public interface IAuditLogManager
{
- Task GetAsync(
+ Task GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default);
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IEntityChangeStore.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IEntityChangeStore.cs
index f2fb5d31c..d6dc4360b 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IEntityChangeStore.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IEntityChangeStore.cs
@@ -34,7 +34,7 @@ public interface IEntityChangeStore
bool includeDetails = false,
CancellationToken cancellationToken = default);
- Task GetWithUsernameAsync(
+ Task GetWithUsernameAsync(
Guid entityChangeId,
CancellationToken cancellationToken = default);
diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/ISecurityLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/ISecurityLogManager.cs
index e031c0b51..eb49bd055 100644
--- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/ISecurityLogManager.cs
+++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/ISecurityLogManager.cs
@@ -7,7 +7,7 @@ namespace LINGYUN.Abp.AuditLogging;
public interface ISecurityLogManager
{
- Task GetAsync(
+ Task GetAsync(
Guid id,
bool includeDetails = false,
CancellationToken cancellationToken = default);
diff --git a/aspnet-core/framework/calendars/LINGYUN.Abp.Calendar/LINGYUN/Abp/Calendar/WorkdayCalendarInfo.cs b/aspnet-core/framework/calendars/LINGYUN.Abp.Calendar/LINGYUN/Abp/Calendar/WorkdayCalendarInfo.cs
index 07ab09520..1c8a1cd68 100644
--- a/aspnet-core/framework/calendars/LINGYUN.Abp.Calendar/LINGYUN/Abp/Calendar/WorkdayCalendarInfo.cs
+++ b/aspnet-core/framework/calendars/LINGYUN.Abp.Calendar/LINGYUN/Abp/Calendar/WorkdayCalendarInfo.cs
@@ -10,7 +10,7 @@ public class WorkdayCalendarInfo
///
/// 日历名称
///
- public string Name { get; set; }
+ public string Name { get; set; } = default!;
///
/// 默认日历
///
@@ -18,7 +18,7 @@ public class WorkdayCalendarInfo
///
/// 工作日范围
///
- public DayOfWeek[] Workdays { get; set; }
+ public DayOfWeek[] Workdays { get; set; } = default!;
///
/// 工作时间范围
///
diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs
index 8533d6ed0..2c4ed91bc 100644
--- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs
+++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs
@@ -5,9 +5,9 @@ namespace LINGYUN.Abp.Aliyun;
[Serializable]
public class AliyunBasicSessionCredentialsCacheItem
{
- public string AccessKeyId { get; set; }
- public string AccessKeySecret { get; set; }
- public string SecurityToken { get; set; }
+ public string AccessKeyId { get; set; } = default!;
+ public string AccessKeySecret { get; set; } = default!;
+ public string SecurityToken { get; set; } = default!;
public DateTime? Expiration { get; set; }
public AliyunBasicSessionCredentialsCacheItem()
diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfiguration.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfiguration.cs
index 3e6e85705..ffd0fd120 100644
--- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfiguration.cs
+++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfiguration.cs
@@ -16,7 +16,7 @@ public class TencentBlobProviderConfiguration
///
/// 区域
///
- public string Region {
+ public string? Region {
get => _containerConfiguration.GetConfiguration(TencentBlobProviderConfigurationNames.Region);
set => _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.Region, value);
}
@@ -39,7 +39,7 @@ public class TencentBlobProviderConfiguration
///
/// 创建命名空间时防盗链列表
///
- public List CreateBucketReferer {
+ public List? CreateBucketReferer {
get => _containerConfiguration.GetConfigurationOrDefault(TencentBlobProviderConfigurationNames.CreateBucketReferer, new List());
set {
if (value == null)
diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentCloudBlobProvider.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentCloudBlobProvider.cs
index 11b6e09fc..cb7aced85 100644
--- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentCloudBlobProvider.cs
+++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentCloudBlobProvider.cs
@@ -58,7 +58,7 @@ public class TencentCloudBlobProvider : BlobProviderBase, ITransientDependency
return await BlobExistsAsync(ossClient, args, blobName);
}
- public override async Task GetOrNullAsync(BlobProviderGetArgs args)
+ public override async Task GetOrNullAsync(BlobProviderGetArgs args)
{
var ossClient = await GetOssClientAsync(args);
var blobName = TencentBlobNameCalculator.Calculate(args);
@@ -129,7 +129,7 @@ public class TencentCloudBlobProvider : BlobProviderBase, ITransientDependency
return ossClient;
}
- protected async virtual Task CreateBucketIfNotExists(CosXml cos, BlobProviderArgs args, IList refererList = null)
+ protected async virtual Task CreateBucketIfNotExists(CosXml cos, BlobProviderArgs args, IList? refererList = null)
{
if (!await BucketExistsAsync(cos, args))
{
diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/Volo/Abp/Sms/TencentSmsSenderExtensions.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/Volo/Abp/Sms/TencentSmsSenderExtensions.cs
index c7c8ecf47..ec202f755 100644
--- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/Volo/Abp/Sms/TencentSmsSenderExtensions.cs
+++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/Volo/Abp/Sms/TencentSmsSenderExtensions.cs
@@ -18,7 +18,7 @@ public static class TencentSmsSenderExtensions
this ISmsSender smsSender,
string templateCode,
string phoneNumber,
- IDictionary templateParams = null)
+ IDictionary? templateParams = null)
{
var smsMessage = new SmsMessage(phoneNumber, nameof(TencentCloudSmsSender));
smsMessage.Properties.Add("TemplateCode", templateCode);
@@ -43,7 +43,7 @@ public static class TencentSmsSenderExtensions
string signName,
string templateCode,
string phoneNumber,
- IDictionary templateParams = null)
+ IDictionary? templateParams = null)
{
var smsMessage = new SmsMessage(phoneNumber, nameof(TencentCloudSmsSender));
smsMessage.Properties.Add("SignName", signName);
diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQCacheItem.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQCacheItem.cs
index 1d63a72f4..9ad8c5d75 100644
--- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQCacheItem.cs
+++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQCacheItem.cs
@@ -5,8 +5,8 @@ namespace LINGYUN.Abp.Tencent.QQ;
public class AbpTencentQQCacheItem
{
public const string CacheKeyFormat = "pn:tenant-cloud,n:qq";
- public string AppId { get; set; }
- public string AppKey { get; set; }
+ public string AppId { get; set; } = default!;
+ public string AppKey { get; set; } = default!;
public bool IsMobile { get; set; }
public AbpTencentQQCacheItem()
{
diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptions.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptions.cs
index 85bb416a9..7fd1ef4d6 100644
--- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptions.cs
+++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptions.cs
@@ -8,14 +8,14 @@ public class AbpTencentQQOptions
///
/// see: https://wiki.connect.qq.com/%e5%87%86%e5%a4%87%e5%b7%a5%e4%bd%9c_oauth2-0
///
- public string AppId { get; set; }
+ public string AppId { get; set; } = default!;
///
/// 在QQ互联上申请的AppKey
///
///
/// see: https://wiki.connect.qq.com/%e5%87%86%e5%a4%87%e5%b7%a5%e4%bd%9c_oauth2-0
///
- public string AppKey { get; set; }
+ public string AppKey { get; set; } = default!;
///
/// 是否移动端样式
///
diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptionsManager.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptionsManager.cs
index c202de39a..c16b57421 100644
--- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptionsManager.cs
+++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptionsManager.cs
@@ -3,6 +3,7 @@ using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using System;
using System.Threading.Tasks;
+using Volo.Abp;
using Volo.Abp.Options;
using Volo.Abp.Settings;
@@ -34,20 +35,20 @@ public class AbpTencentQQOptionsManager : AbpDynamicOptionsManager GetCacheItemAsync()
{
var cacheKey = AbpTencentQQCacheItem.CalculateCacheKey();
+ var cacheItem = TencentCache.Get(cacheKey);
+ if (cacheItem == null)
+ {
+ var appId = await SettingProvider.GetOrNullAsync(TencentQQSettingNames.QQConnect.AppId);
+ var appKey = await SettingProvider.GetOrNullAsync(TencentQQSettingNames.QQConnect.AppKey);
+ var isMobile = await SettingProvider.IsTrueAsync(TencentQQSettingNames.QQConnect.IsMobile);
- var cacheItem = await TencentCache.GetOrCreateAsync(
- cacheKey,
- async (cache) =>
- {
- var appId = await SettingProvider.GetOrNullAsync(TencentQQSettingNames.QQConnect.AppId);
- var appKey = await SettingProvider.GetOrNullAsync(TencentQQSettingNames.QQConnect.AppKey);
- var isMobile = await SettingProvider.IsTrueAsync(TencentQQSettingNames.QQConnect.IsMobile);
+ Check.NotNullOrWhiteSpace(appId, nameof(appId));
+ Check.NotNullOrWhiteSpace(appKey, nameof(appKey));
- cache.SetAbsoluteExpiration(TimeSpan.FromMinutes(2d));
-
- return new AbpTencentQQCacheItem(appId, appKey, isMobile);
- });
+ cacheItem = new AbpTencentQQCacheItem(appId, appKey, isMobile);
+ TencentCache.Set(cacheKey, cacheItem, TimeSpan.FromMinutes(2d));
+ }
return cacheItem;
}
}
diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN/Abp/Tencent/SettingManagement/TencentCloudSettingAppService.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN/Abp/Tencent/SettingManagement/TencentCloudSettingAppService.cs
index 2cb8616aa..c2c39a507 100644
--- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN/Abp/Tencent/SettingManagement/TencentCloudSettingAppService.cs
+++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN/Abp/Tencent/SettingManagement/TencentCloudSettingAppService.cs
@@ -42,7 +42,7 @@ public class TencentCloudSettingAppService : ApplicationService, ITencentCloudSe
return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null);
}
- protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey)
+ protected async virtual Task GetAllForProviderAsync(string providerName, string? providerKey = null)
{
var settingGroups = new SettingGroupResult();
@@ -61,7 +61,7 @@ public class TencentCloudSettingAppService : ApplicationService, ITencentCloudSe
await SettingManager.GetOrNullAsync(TencentCloudSettingNames.EndPoint, providerName, providerKey),
ValueType.Option,
providerName)
- .AddOptions(GetAvailableRegionOptions());
+ ?.AddOptions(GetAvailableRegionOptions());
basicSetting.AddDetail(
await SettingDefinitionManager.GetAsync(TencentCloudSettingNames.SecretId),
StringLocalizerFactory,
@@ -94,8 +94,8 @@ public class TencentCloudSettingAppService : ApplicationService, ITencentCloudSe
await SettingManager.GetOrNullAsync(TencentCloudSettingNames.Connection.HttpMethod, providerName, providerKey),
ValueType.Option,
providerName)
- .AddOption("POST", "POST")
- .AddOption("GET", "GET");
+ ?.AddOption("POST", "POST")
+ ?.AddOption("GET", "GET");
connectionSetting.AddDetail(
await SettingDefinitionManager.GetAsync(TencentCloudSettingNames.Connection.Timeout),
StringLocalizerFactory,
diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/AbstractTencentCloudClientFactory.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/AbstractTencentCloudClientFactory.cs
index 3f4faa3e9..717aaebf0 100644
--- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/AbstractTencentCloudClientFactory.cs
+++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/AbstractTencentCloudClientFactory.cs
@@ -31,37 +31,39 @@ public abstract class AbstractTencentCloudClientFactory
protected async virtual Task GetClientCacheItemAsync()
{
- return await ClientCache.GetOrCreateAsync(
- TencentCloudClientCacheItem.CalculateCacheKey("client-options"),
- async (cache) =>
+ var cacheKey = TencentCloudClientCacheItem.CalculateCacheKey("client-options");
+ var cacheItem = ClientCache.Get(cacheKey);
+ if (cacheItem == null)
+ {
+ var secretId = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretId);
+ var secretKey = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretKey);
+ var endpoint = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.EndPoint);
+ var durationSecond = await SettingProvider.GetAsync(TencentCloudSettingNames.DurationSecond, 3600);
+
+ Check.NotNullOrWhiteSpace(secretId, TencentCloudSettingNames.SecretId);
+ Check.NotNullOrWhiteSpace(secretKey, TencentCloudSettingNames.SecretKey);
+
+
+ var method = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.HttpMethod);
+ var webProxy = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.WebProxy);
+ var timeout = await SettingProvider.GetAsync(TencentCloudSettingNames.Connection.Timeout, 60);
+
+ cacheItem = new TencentCloudClientCacheItem
{
- var secretId = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretId);
- var secretKey = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretKey);
- var endpoint = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.EndPoint);
- var durationSecond = await SettingProvider.GetAsync(TencentCloudSettingNames.DurationSecond, 3600);
-
- Check.NotNullOrWhiteSpace(secretId, TencentCloudSettingNames.SecretId);
- Check.NotNullOrWhiteSpace(secretKey, TencentCloudSettingNames.SecretKey);
-
-
- var method = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.HttpMethod);
- var webProxy = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.WebProxy);
- var timeout = await SettingProvider.GetAsync(TencentCloudSettingNames.Connection.Timeout, 60);
-
- cache.SetAbsoluteExpiration(TimeSpan.FromSeconds(durationSecond));
-
- return new TencentCloudClientCacheItem
- {
- SecretId = secretId,
- SecretKey = secretKey,
- // 连接区域
- EndPoint = endpoint,
- DurationSecond = durationSecond,
- HttpMethod = method,
- WebProxy = webProxy,
- Timeout = timeout,
- };
- });
+ SecretId = secretId,
+ SecretKey = secretKey,
+ // 连接区域
+ EndPoint = endpoint,
+ DurationSecond = durationSecond,
+ HttpMethod = method,
+ WebProxy = webProxy,
+ Timeout = timeout,
+ };
+
+ ClientCache.Set(cacheKey, cacheItem, TimeSpan.FromSeconds(durationSecond));
+ }
+
+ return cacheItem;
}
}
@@ -89,36 +91,38 @@ public abstract class AbstractTencentCloudClientFactory
protected async virtual Task GetClientCacheItemAsync()
{
- return await ClientCache.GetOrCreateAsync(
- TencentCloudClientCacheItem.CalculateCacheKey("client-options"),
- async (cache) =>
+ var cacheKey = TencentCloudClientCacheItem.CalculateCacheKey("client-options");
+ var cacheItem = ClientCache.Get(cacheKey);
+ if (cacheItem == null)
+ {
+ var secretId = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretId);
+ var secretKey = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretKey);
+ var endpoint = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.EndPoint);
+ var durationSecond = await SettingProvider.GetAsync(TencentCloudSettingNames.DurationSecond, 3600);
+
+ Check.NotNullOrWhiteSpace(secretId, TencentCloudSettingNames.SecretId);
+ Check.NotNullOrWhiteSpace(secretKey, TencentCloudSettingNames.SecretKey);
+
+
+ var method = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.HttpMethod);
+ var webProxy = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.WebProxy);
+ var timeout = await SettingProvider.GetAsync(TencentCloudSettingNames.Connection.Timeout, 60);
+
+ cacheItem = new TencentCloudClientCacheItem
{
- var secretId = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretId);
- var secretKey = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.SecretKey);
- var endpoint = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.EndPoint);
- var durationSecond = await SettingProvider.GetAsync(TencentCloudSettingNames.DurationSecond, 3600);
-
- Check.NotNullOrWhiteSpace(secretId, TencentCloudSettingNames.SecretId);
- Check.NotNullOrWhiteSpace(secretKey, TencentCloudSettingNames.SecretKey);
-
-
- var method = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.HttpMethod);
- var webProxy = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Connection.WebProxy);
- var timeout = await SettingProvider.GetAsync(TencentCloudSettingNames.Connection.Timeout, 60);
-
- cache.SetAbsoluteExpiration(TimeSpan.FromSeconds(durationSecond));
-
- return new TencentCloudClientCacheItem
- {
- SecretId = secretId,
- SecretKey = secretKey,
- // 连接区域
- EndPoint = endpoint,
- DurationSecond = durationSecond,
- HttpMethod = method,
- WebProxy = webProxy,
- Timeout = timeout,
- };
- });
+ SecretId = secretId,
+ SecretKey = secretKey,
+ // 连接区域
+ EndPoint = endpoint,
+ DurationSecond = durationSecond,
+ HttpMethod = method,
+ WebProxy = webProxy,
+ Timeout = timeout,
+ };
+
+ ClientCache.Set(cacheKey, cacheItem, TimeSpan.FromSeconds(durationSecond));
+ }
+
+ return cacheItem;
}
}
diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientCacheItem.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientCacheItem.cs
index 40c59e7ed..1935a6d21 100644
--- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientCacheItem.cs
+++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientCacheItem.cs
@@ -3,12 +3,12 @@
public class TencentCloudClientCacheItem
{
public const string CacheKeyFormat = "pn:tenant-cloud,n:{0}";
- public string SecretId { get; set; }
- public string SecretKey { get; set; }
- public string EndPoint { get; set; }
- public string WebProxy { get; set; }
- public string ApiEndPoint { get; set; }
- public string HttpMethod { get; set; }
+ public string SecretId { get; set; } = default!;
+ public string SecretKey { get; set; } = default!;
+ public string? EndPoint { get; set; }
+ public string? WebProxy { get; set; }
+ public string? ApiEndPoint { get; set; }
+ public string? HttpMethod { get; set; }
public int Timeout { get; set; }
public int DurationSecond { get; set; }
diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientFactory.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientFactory.cs
index 141d573f9..56e0c4dff 100644
--- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientFactory.cs
+++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientFactory.cs
@@ -46,7 +46,7 @@ public class TencentCloudClientFactory : AbstractTencentCloudClientFact
// 通过反射创建客户端实例
// TODO: 如果影响到性能需要调整到通过Options手动创建实例
- return (TClient)clientCtr.Invoke(new object[] { cred, cloudCache.EndPoint, clientProfile });
+ return (TClient)clientCtr.Invoke(new object?[] { cred, cloudCache.EndPoint, clientProfile });
}
throw new AbpException($"Failed to specify initialization Type for client {typeof(TClient).FullName}. Client instance could not be created");
diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN/Abp/AspNetCore/WebClientInfo/RequestForwardedHeaderWebClientInfoProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN/Abp/AspNetCore/WebClientInfo/RequestForwardedHeaderWebClientInfoProvider.cs
index d30e700c0..199c4a71e 100644
--- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN/Abp/AspNetCore/WebClientInfo/RequestForwardedHeaderWebClientInfoProvider.cs
+++ b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN/Abp/AspNetCore/WebClientInfo/RequestForwardedHeaderWebClientInfoProvider.cs
@@ -24,9 +24,9 @@ public class RequestForwardedHeaderWebClientInfoProvider : HttpContextWebClientI
Options = options.Value;
}
- protected override string GetClientIpAddress()
+ protected override string? GetClientIpAddress()
{
- string forwardedForHeader = null;
+ string? forwardedForHeader = null;
var requestHeaders = HttpContextAccessor.HttpContext?.Request?.Headers;
if (requestHeaders != null &&
Options.ForwardedHeaders.HasFlag(ForwardedHeaders.XForwardedFor) &&
diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs
index a1ed81a40..bdbdcff7b 100644
--- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs
+++ b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs
@@ -50,23 +50,25 @@ public class MvcCachedApplicationConfigurationClient : ICachedApplicationConfigu
return configuration;
}
- configuration = await Cache.GetOrAddAsync(
- cacheKey,
- async () => await Proxy.Service.GetAsync(new ApplicationConfigurationRequestOptions()),
- () => new DistributedCacheEntryOptions
- {
- AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(CurrentUser.IsAuthenticated
- ? MvcClientCacheOptions.UserCacheExpirationSeconds
- : MvcClientCacheOptions.AnonymousCacheExpirationSeconds)
- }
- );
-
- if (httpContext != null)
+ var configurationDto = await Cache.GetAsync(cacheKey);
+ if (configurationDto != null)
{
- httpContext.Items[cacheKey] = configuration;
+ httpContext?.Items[cacheKey] = configurationDto;
+ return configurationDto;
}
- return configuration;
+ configurationDto = await Proxy.Service.GetAsync(new ApplicationConfigurationRequestOptions());
+
+ await Cache.SetAsync(cacheKey, configurationDto, new DistributedCacheEntryOptions
+ {
+ AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(CurrentUser.IsAuthenticated
+ ? MvcClientCacheOptions.UserCacheExpirationSeconds
+ : MvcClientCacheOptions.AnonymousCacheExpirationSeconds)
+ });
+
+ httpContext?.Items[cacheKey] = configurationDto;
+
+ return configurationDto;
}
public ApplicationConfigurationDto Get()
diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/AbpExceptionHandlingWrapperMiddleware.cs b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/AbpExceptionHandlingWrapperMiddleware.cs
index 7f4568163..f88dc2ba6 100644
--- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/AbpExceptionHandlingWrapperMiddleware.cs
+++ b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/AbpExceptionHandlingWrapperMiddleware.cs
@@ -126,8 +126,8 @@ public class AbpExceptionHandlingWrapperMiddleware : IMiddleware, ITransientDepe
httpContext.Response.Headers.Append("Content-Type", "application/json");
var wrapResult = new WrapResult(
- exceptionWrapContext.ErrorInfo.Code,
- exceptionWrapContext.ErrorInfo.Message,
+ exceptionWrapContext.ErrorInfo.Code!,
+ exceptionWrapContext.ErrorInfo.Message!,
exceptionWrapContext.ErrorInfo.Details);
await httpContext.Response.WriteAsync(jsonSerializer.Serialize(wrapResult));
}
diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/HttpResponseWrapperContext.cs b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/HttpResponseWrapperContext.cs
index e7f6e3624..605311e8f 100644
--- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/HttpResponseWrapperContext.cs
+++ b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/HttpResponseWrapperContext.cs
@@ -10,7 +10,7 @@ public class HttpResponseWrapperContext
public HttpResponseWrapperContext(
HttpContext httpContext,
int httpStatusCode,
- IDictionary httpHeaders = null)
+ IDictionary? httpHeaders = null)
{
HttpContext = httpContext;
HttpStatusCode = httpStatusCode;
diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs
index 4aa760801..7c154be14 100644
--- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs
+++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs
@@ -61,7 +61,7 @@ public class AliyunBlobProvider : BlobProviderBase, ITransientDependency
return await BlobExistsAsync(ossClient, args, blobName);
}
- public override async Task GetOrNullAsync(BlobProviderGetArgs args)
+ public override async Task GetOrNullAsync(BlobProviderGetArgs args)
{
using var ossClient = await GetOssClientAsync(args);
var blobName = AliyunBlobNameCalculator.Calculate(args);
diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfiguration.cs b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfiguration.cs
index 8cdf5e126..95d0f5740 100644
--- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfiguration.cs
+++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfiguration.cs
@@ -34,7 +34,7 @@ public class AliyunBlobProviderConfiguration
/// 签名版本(可选项:v1、v4)
/// 默认: v1
///
- public string SignatureVersion {
+ public string? SignatureVersion {
get => _containerConfiguration.GetConfigurationOrDefault(AliyunBlobProviderConfigurationNames.SignatureVersion, DefaultSignatureVersion);
set => _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.SignatureVersion, value);
}
@@ -63,7 +63,7 @@ public class AliyunBlobProviderConfiguration
///
/// 创建命名空间时防盗链列表
///
- public List CreateBucketReferer
+ public List? CreateBucketReferer
{
get => _containerConfiguration.GetConfigurationOrDefault(AliyunBlobProviderConfigurationNames.CreateBucketReferer, new List());
set
@@ -85,7 +85,7 @@ public class AliyunBlobProviderConfiguration
set => _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.PresignedGetExpirySeconds, value);
}
- public string Endpoint {
+ public string? Endpoint {
get => _containerConfiguration.GetConfigurationOrDefault(AliyunBlobProviderConfigurationNames.Endpoint, null);
set => _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.Endpoint, value);
}
diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs b/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs
index 3924bc4de..9a8d95d1b 100644
--- a/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs
+++ b/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs
@@ -33,7 +33,7 @@ public class DefaultDbSchemaMigrator : IDbSchemaMigrator, ITransientDependency
{
var connectionStringName = ConnectionStringNameAttribute.GetConnStringName();
- string connectionString = null;
+ string? connectionString = null;
if (_currentTenant.IsAvailable)
{
var connectionStringResolver = _serviceProvider.GetRequiredService();
@@ -57,10 +57,10 @@ public class DefaultDbSchemaMigrator : IDbSchemaMigrator, ITransientDependency
return;
}
- connectionString??= defaultConnectionString;
+ connectionString ??= defaultConnectionString;
var dbContextBuilder = new DbContextOptionsBuilder();
- using var dbContext = configureDbContext(connectionString, dbContextBuilder);
+ using var dbContext = configureDbContext(connectionString!, dbContextBuilder);
await dbContext.Database.MigrateAsync();
}
diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPBootstrapper.cs b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPBootstrapper.cs
index 0208f411d..98dfd3f00 100644
--- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPBootstrapper.cs
+++ b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPBootstrapper.cs
@@ -15,7 +15,7 @@ public class AbpCAPBootstrapper : IBootstrapper
private readonly ILogger _logger;
private readonly IServiceProvider _serviceProvider;
- private CancellationTokenSource _cts;
+ private CancellationTokenSource? _cts;
private bool _disposed;
private IEnumerable _processors = default!;
diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPConsumerServiceSelector.cs b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPConsumerServiceSelector.cs
index 4dec7cf1f..63064307c 100644
--- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPConsumerServiceSelector.cs
+++ b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPConsumerServiceSelector.cs
@@ -112,7 +112,7 @@ public class AbpCAPConsumerServiceSelector : ConsumerServiceSelector
);
// TODO: 事件名称定义在事件参数类型,就无法创建多个订阅者类了,增加可选配置,让用户决定事件名称定义在哪里
var eventName = EventNameAttribute.GetNameOrDefault(eventType);
- var topicAttr = method.GetCustomAttributes(true);
+ var topicAttr = method!.GetCustomAttributes(true);
var topicAttributes = topicAttr.ToList();
topicAttributes.Add(new CapSubscribeAttribute(eventName));
@@ -121,10 +121,10 @@ public class AbpCAPConsumerServiceSelector : ConsumerServiceSelector
{
SetSubscribeAttribute(attr);
- var parameters = method.GetParameters()
+ var parameters = method!.GetParameters()
.Select(parameter => new ParameterDescriptor
{
- Name = parameter.Name,
+ Name = parameter.Name!,
ParameterType = parameter.ParameterType,
IsFromCap = parameter.GetCustomAttributes(typeof(FromCapAttribute)).Any()
}).ToList();
diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPMessageExtensions.cs b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPMessageExtensions.cs
index b4745f073..924c6f1af 100644
--- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPMessageExtensions.cs
+++ b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPMessageExtensions.cs
@@ -18,9 +18,9 @@ public static class AbpCAPMessageExtensions
this Message message,
out Guid? tenantId)
{
- if (message.Headers.TryGetValue(AbpCAPHeaders.TenantId, out string tenantStr))
+ if (message.Headers.TryGetValue(AbpCAPHeaders.TenantId, out var tenantStr))
{
- if (Guid.TryParse(tenantStr, out Guid id))
+ if (Guid.TryParse(tenantStr, out var id))
{
tenantId = id;
return true;
@@ -37,7 +37,7 @@ public static class AbpCAPMessageExtensions
public static Guid? GetTenantIdOrNull(
this Message message)
{
- if (message.TryGetTenantId(out Guid? tenantId))
+ if (message.TryGetTenantId(out var tenantId))
{
return tenantId;
}
@@ -51,7 +51,7 @@ public static class AbpCAPMessageExtensions
///
public static bool TryGetCorrelationId(
this Message message,
- out string correlationId)
+ out string? correlationId)
{
return message.Headers.TryGetValue(AbpCAPHeaders.CorrelationId, out correlationId);
}
@@ -60,7 +60,7 @@ public static class AbpCAPMessageExtensions
///
///
///
- public static string GetCorrelationIdOrNull(this Message message)
+ public static string? GetCorrelationIdOrNull(this Message message)
{
if (message.TryGetCorrelationId(out var correlationId))
{
diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPSubscribeInvoker.cs b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPSubscribeInvoker.cs
index 91398617a..243fd8b54 100644
--- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPSubscribeInvoker.cs
+++ b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPSubscribeInvoker.cs
@@ -82,7 +82,7 @@ public class AbpCAPSubscribeInvoker : ISubscribeInvoker
var message = context.DeliverMessage;
var parameterDescriptors = context.ConsumerDescriptor.Parameters;
- var executeParameters = new object[parameterDescriptors.Count];
+ var executeParameters = new object?[parameterDescriptors.Count];
// 租户数据可能在消息标头中
var tenantId = message.GetTenantIdOrNull();
var correlationId = message.GetCorrelationIdOrNull();
@@ -154,7 +154,7 @@ public class AbpCAPSubscribeInvoker : ISubscribeInvoker
using (_currentTenant.Change(tenantId))
{
var filter = provider.GetService();
- object resultObj = null;
+ object? resultObj = null;
try
{
@@ -204,7 +204,7 @@ public class AbpCAPSubscribeInvoker : ISubscribeInvoker
else
{
var capHeader = executeParameters.FirstOrDefault(x => x is CapHeader) as CapHeader;
- IDictionary callbackHeader = null;
+ IDictionary? callbackHeader = null;
// TODO: CapHeader.ResponseHeader
return new ConsumerExecutedResult(resultObj, message.GetId(), callbackName, callbackHeader);
}
@@ -245,10 +245,10 @@ public class AbpCAPSubscribeInvoker : ISubscribeInvoker
var srvType = context.ConsumerDescriptor.ServiceTypeInfo?.AsType();
var implType = context.ConsumerDescriptor.ImplTypeInfo.AsType();
- object obj = null;
+ object? obj = null;
if (srvType != null)
{
- obj = provider.GetServices(srvType).FirstOrDefault(o => o.GetType() == implType);
+ obj = provider.GetServices(srvType).FirstOrDefault(o => o?.GetType() == implType);
}
if (obj == null)
@@ -265,7 +265,7 @@ public class AbpCAPSubscribeInvoker : ISubscribeInvoker
///
///
///
- private async Task