From de877d8a36932a704aa0a520c90dbea572214f26 Mon Sep 17 00:00:00 2001 From: Mark Cilia Vincenti Date: Fri, 16 Aug 2024 11:41:42 +0200 Subject: [PATCH 1/3] Cleaning up warnings. --- .../AbpAspNetCoreMultiTenancyOptions.cs | 2 +- .../AbpDatePickerBaseTagHelperService.cs | 6 ++++-- .../AspNetCore/Mvc/Uow/AbpUowActionFilter.cs | 2 +- .../AspNetCore/Mvc/Uow/AbpUowPageFilter.cs | 2 +- .../Validation/ValidationAttributeHelper.cs | 2 +- .../AbpExceptionHandlingMiddleware.cs | 4 ++-- .../IPermissionDefinitionContext.cs | 1 - .../Components/UiNotificationAlert.razor | 2 +- .../Volo/Abp/Cli/Commands/NewCommand.cs | 2 +- .../Commands/ProjectCreationCommandBase.cs | 20 +++++++++---------- .../Commands/Services/DotnetEfToolManager.cs | 8 +++----- .../Volo/Abp/Cli/Commands/TranslateCommand.cs | 2 +- .../ProjectNugetPackageAdder.cs | 2 +- ...mmonDbContextRegistrationOptionsBuilder.cs | 8 ++++---- .../Auditing/AuditedAggregateRootWithUser.cs | 4 ++-- .../CreationAuditedAggregateRootWithUser.cs | 4 ++-- .../Auditing/CreationAuditedEntityWithUser.cs | 2 +- .../Auditing/FullAuditedEntityWithUser.cs | 2 +- .../Volo/Abp/Emailing/AbpEmailingModule.cs | 2 ++ .../MySqlConnectionStringChecker.cs | 2 +- .../OracleDevartConnectionStringChecker.cs | 2 +- .../OracleConnectionStringChecker.cs | 2 +- .../NpgsqlConnectionStringChecker.cs | 2 +- .../SqlServerConnectionStringChecker.cs | 2 +- .../SqliteConnectionStringChecker.cs | 2 +- .../Distributed/DistributedEventBusBase.cs | 4 ++-- .../Volo/Abp/Guids/SequentialGuidType.cs | 6 ++++-- .../Newtonsoft/AbpNewtonsoftJsonSerializer.cs | 2 ++ .../MongoDBConnectionStringChecker.cs | 2 +- .../UnitOfWorkMongoDbContextProvider.cs | 2 +- .../Volo/Abp/ObjectMapping/IObjectMapper.cs | 8 ++++---- .../Abp/TextTemplating/TemplateDefinition.cs | 4 ++-- .../Razor/EmptyProjectFileSystem.cs | 4 +++- .../Abp/Ui/Navigation/ApplicationMenuItem.cs | 1 + .../RemoteStreamContentTestController.cs | 3 ++- .../EntityFrameworkCore/TestAppDbContext.cs | 2 -- 36 files changed, 67 insertions(+), 60 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyOptions.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyOptions.cs index 95efaf2d0c..6b26236ea1 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyOptions.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyOptions.cs @@ -67,7 +67,7 @@ public class AbpAspNetCoreMultiTenancyOptions } } - context.Response.Headers.Add("Abp-Tenant-Resolve-Error", HtmlEncoder.Default.Encode(exception.Message)); + context.Response.Headers.Append("Abp-Tenant-Resolve-Error", HtmlEncoder.Default.Encode(exception.Message)); if (isCookieAuthentication && context.Request.Method.Equals("Get", StringComparison.OrdinalIgnoreCase) && !context.Request.IsAjax()) { context.Response.Redirect(context.Request.GetEncodedUrl()); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs index d2ed433161..bd3a4abe48 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs @@ -364,12 +364,14 @@ public abstract class AbpDatePickerBaseTagHelperService : AbpTagHelp attrList.Add("data-parent-el", options.ParentEl); } +#pragma warning disable CS0618 // Type or member is obsolete if (!options.DateFormat.IsNullOrEmpty()) { attrList.Add("data-date-format", options.DateFormat); } - - if(!options.VisibleDateFormat.IsNullOrEmpty()) +#pragma warning restore CS0618 // Type or member is obsolete + + if (!options.VisibleDateFormat.IsNullOrEmpty()) { attrList.Add("data-visible-date-format", options.VisibleDateFormat); } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowActionFilter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowActionFilter.cs index 4a6a04a554..5ed2c52e77 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowActionFilter.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowActionFilter.cs @@ -103,7 +103,7 @@ public class AbpUowActionFilter : IAsyncActionFilter, IAbpFilter, ITransientDepe { await currentUow.SaveChangesAsync(context.HttpContext.RequestAborted); } - catch (Exception e) + catch (Exception) { await currentUow.RollbackAsync(context.HttpContext.RequestAborted); throw; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowPageFilter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowPageFilter.cs index f4a7be3333..45f79713dd 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowPageFilter.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowPageFilter.cs @@ -109,7 +109,7 @@ public class AbpUowPageFilter : IAsyncPageFilter, IAbpFilter, ITransientDependen { await currentUow.SaveChangesAsync(context.HttpContext.RequestAborted); } - catch (Exception e) + catch (Exception) { await currentUow.RollbackAsync(context.HttpContext.RequestAborted); throw; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/ValidationAttributeHelper.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/ValidationAttributeHelper.cs index cd87c55ea4..d2d8a0bf14 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/ValidationAttributeHelper.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/ValidationAttributeHelper.cs @@ -30,7 +30,7 @@ public static class ValidationAttributeHelper var errorMessageString = ValidationAttributeErrorMessageStringProperty.GetValue(validationAttribute) as string; validationAttribute.ErrorMessage = errorMessageString; } - catch (Exception e) + catch (Exception) { // ignored } diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpExceptionHandlingMiddleware.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpExceptionHandlingMiddleware.cs index 7d5ef610e5..aa8f79769c 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpExceptionHandlingMiddleware.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpExceptionHandlingMiddleware.cs @@ -82,8 +82,8 @@ public class AbpExceptionHandlingMiddleware : AbpMiddlewareBase, ITransientDepen httpContext.Response.Clear(); httpContext.Response.StatusCode = (int)statusCodeFinder.GetStatusCode(httpContext, exception); httpContext.Response.OnStarting(_clearCacheHeadersDelegate, httpContext.Response); - httpContext.Response.Headers.Add(AbpHttpConsts.AbpErrorFormat, "true"); - httpContext.Response.Headers.Add("Content-Type", "application/json"); + httpContext.Response.Headers.Append(AbpHttpConsts.AbpErrorFormat, "true"); + httpContext.Response.Headers.Append("Content-Type", "application/json"); await httpContext.Response.WriteAsync( jsonSerializer.Serialize( diff --git a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionContext.cs b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionContext.cs index 4f686a6bae..bc8a49ddf6 100644 --- a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionContext.cs +++ b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionContext.cs @@ -32,7 +32,6 @@ public interface IPermissionDefinitionContext /// Throws if there is a group with the name. /// Name of the group /// Localized display name of the group - /// Select a multi-tenancy side /// PermissionGroupDefinition AddGroup( [NotNull] string name, diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor index 23f5e79786..02b776e24a 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs index cde8dcb42c..fa3969dbeb 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs @@ -151,7 +151,7 @@ public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransien var redis = await ConnectionMultiplexer.ConnectAsync("127.0.0.1", options => options.ConnectTimeout = 3000); isConnected = redis.IsConnected; } - catch (Exception e) + catch (Exception) { // ignored } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs index d1e54868c4..335f5faef4 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs @@ -81,7 +81,7 @@ public abstract class ProjectCreationCommandBase if (version != null) { - Logger.LogInformation("Version: " + version); + Logger.LogInformation($"Version: {version}"); } var preview = commandLineArgs.Options.ContainsKey(Options.Preview.Long); @@ -110,25 +110,25 @@ public abstract class ProjectCreationCommandBase var databaseProvider = GetDatabaseProvider(commandLineArgs); if (databaseProvider != DatabaseProvider.NotSpecified) { - Logger.LogInformation("Database provider: " + databaseProvider); + Logger.LogInformation($"Database provider: {databaseProvider}"); } var connectionString = GetConnectionString(commandLineArgs); if (connectionString != null) { - Logger.LogInformation("Connection string: " + connectionString); + Logger.LogInformation($"Connection string: {connectionString}"); } var databaseManagementSystem = GetDatabaseManagementSystem(commandLineArgs); if (databaseManagementSystem != DatabaseManagementSystem.NotSpecified) { - Logger.LogInformation("DBMS: " + databaseManagementSystem); + Logger.LogInformation($"DBMS: {databaseManagementSystem}"); } var uiFramework = GetUiFramework(commandLineArgs, template); if (uiFramework != UiFramework.NotSpecified) { - Logger.LogInformation("UI Framework: " + uiFramework); + Logger.LogInformation($"UI Framework: {uiFramework}"); } var publicWebSite = uiFramework != UiFramework.None && commandLineArgs.Options.ContainsKey(Options.PublicWebSite.Long); @@ -140,25 +140,25 @@ public abstract class ProjectCreationCommandBase var mobileApp = GetMobilePreference(commandLineArgs); if (mobileApp != MobileApp.None) { - Logger.LogInformation("Mobile App: " + mobileApp); + Logger.LogInformation($"Mobile App: {mobileApp}"); } var gitHubAbpLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubAbpLocalRepositoryPath.Long); if (gitHubAbpLocalRepositoryPath != null) { - Logger.LogInformation("GitHub Abp Local Repository Path: " + gitHubAbpLocalRepositoryPath); + Logger.LogInformation($"GitHub Abp Local Repository Path: {gitHubAbpLocalRepositoryPath}"); } var gitHubVoloLocalRepositoryPath = commandLineArgs.Options.GetOrNull(Options.GitHubVoloLocalRepositoryPath.Long); if (gitHubVoloLocalRepositoryPath != null) { - Logger.LogInformation("GitHub Volo Local Repository Path: " + gitHubVoloLocalRepositoryPath); + Logger.LogInformation($"GitHub Volo Local Repository Path: {gitHubVoloLocalRepositoryPath}"); } var templateSource = commandLineArgs.Options.GetOrNull(Options.TemplateSource.Short, Options.TemplateSource.Long); if (templateSource != null) { - Logger.LogInformation("Template Source: " + templateSource); + Logger.LogInformation($"Template Source: {templateSource}"); } var createSolutionFolder = GetCreateSolutionFolderPreference(commandLineArgs); @@ -216,7 +216,7 @@ public abstract class ProjectCreationCommandBase IO.DirectoryHelper.CreateIfNotExists(outputFolder); - Logger.LogInformation("Output folder: " + outputFolder); + Logger.LogInformation($"Output folder: {outputFolder}"); if (connectionString == null && databaseManagementSystem != DatabaseManagementSystem.NotSpecified && diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/DotnetEfToolManager.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/DotnetEfToolManager.cs index cbeb6ee9d4..4dbbb6fe01 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/DotnetEfToolManager.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/DotnetEfToolManager.cs @@ -20,12 +20,10 @@ public class DotnetEfToolManager : ISingletonDependency public async Task BeSureInstalledAsync() { - if (IsDotNetEfToolInstalled()) + if (!IsDotNetEfToolInstalled()) { - return; - } - - InstallDotnetEfTool(); + InstallDotnetEfTool(); + } } private bool IsDotNetEfToolInstalled() diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs index b15fb8c653..f1482d5a85 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs @@ -412,7 +412,7 @@ public class TranslateCommand : IConsoleCommand, ITransientDependency { jObject = JObject.Parse(json); } - catch (Exception e) + catch (Exception) { return null; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs index 0697c00293..b0fde75ca5 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs @@ -291,7 +291,7 @@ public class ProjectNugetPackageAdder : ITransientDependency { await RunBundleForBlazorAsync(projectFile); } - catch (Exception e) + catch (Exception) { Logger.LogWarning("Couldn't run bundle for blazor."); } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/IAbpCommonDbContextRegistrationOptionsBuilder.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/IAbpCommonDbContextRegistrationOptionsBuilder.cs index ee580332a8..d0842de7ee 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/IAbpCommonDbContextRegistrationOptionsBuilder.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/IAbpCommonDbContextRegistrationOptionsBuilder.cs @@ -20,23 +20,23 @@ public interface IAbpCommonDbContextRegistrationOptionsBuilder /// /// Registers default repositories for all the entities in this DbContext. - /// Default repositories will use given . + /// Default repositories will use given . /// /// DbContext type that will be used by default repositories /// /// Registers repositories only for aggregate root entities by default. - /// Set to true to include all entities. + /// Set to true to include all entities. /// IAbpCommonDbContextRegistrationOptionsBuilder AddDefaultRepositories(bool includeAllEntities = false); /// /// Registers default repositories for all the entities in this DbContext. - /// Default repositories will use given . + /// Default repositories will use given . /// /// DbContext type that will be used by default repositories /// /// Registers repositories only for aggregate root entities by default. - /// Set to true to include all entities. + /// Set to true to include all entities. /// IAbpCommonDbContextRegistrationOptionsBuilder AddDefaultRepositories(Type defaultRepositoryDbContextType, bool includeAllEntities = false); diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRootWithUser.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRootWithUser.cs index f38c21d2fe..79b73b4619 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRootWithUser.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRootWithUser.cs @@ -4,7 +4,7 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Domain.Entities.Auditing; /// -/// This class can be used to simplify implementing for aggregate roots. +/// This class can be used to simplify implementing for aggregate roots. /// /// Type of the user [Serializable] @@ -19,7 +19,7 @@ public abstract class AuditedAggregateRootWithUser : AuditedAggregateRoot } /// -/// This class can be used to simplify implementing for aggregate roots. +/// This class can be used to simplify implementing for aggregate roots. /// /// Type of the primary key of the entity /// Type of the user diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRootWithUser.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRootWithUser.cs index 4407a93de8..fb0272360b 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRootWithUser.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRootWithUser.cs @@ -4,7 +4,7 @@ using Volo.Abp.Auditing; namespace Volo.Abp.Domain.Entities.Auditing; /// -/// This class can be used to simplify implementing for aggregate roots. +/// This class can be used to simplify implementing for aggregate roots. /// /// Type of the user [Serializable] @@ -15,7 +15,7 @@ public abstract class CreationAuditedAggregateRootWithUser : CreationAudi } /// -/// This class can be used to simplify implementing for aggregate roots. +/// This class can be used to simplify implementing for aggregate roots. /// /// Type of the primary key of the entity /// Type of the user diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntityWithUser.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntityWithUser.cs index 635bb06183..870547d255 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntityWithUser.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntityWithUser.cs @@ -15,7 +15,7 @@ public abstract class CreationAuditedEntityWithUser : CreationAuditedEnti } /// -/// This class can be used to simplify implementing . +/// This class can be used to simplify implementing . /// /// Type of the primary key of the entity /// Type of the user diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntityWithUser.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntityWithUser.cs index 834b106d95..8bcbd61306 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntityWithUser.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntityWithUser.cs @@ -22,7 +22,7 @@ public abstract class FullAuditedEntityWithUser : FullAuditedEntity, IFul } /// -/// Implements to be a base class for full-audited entities. +/// Implements to be a base class for full-audited entities. /// /// Type of the primary key of the entity /// Type of the user diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs index ad380d7128..523ca071a1 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs @@ -13,7 +13,9 @@ namespace Volo.Abp.Emailing; typeof(AbpVirtualFileSystemModule), typeof(AbpBackgroundJobsAbstractionsModule), typeof(AbpLocalizationModule), +#pragma warning disable CS0618 // Type or member is obsolete typeof(AbpTextTemplatingModule) +#pragma warning restore CS0618 // Type or member is obsolete )] public class AbpEmailingModule : AbpModule { diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo/Abp/EntityFrameworkCore/ConnectionStrings/MySqlConnectionStringChecker.cs b/framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo/Abp/EntityFrameworkCore/ConnectionStrings/MySqlConnectionStringChecker.cs index a77821b9df..67de4ac754 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo/Abp/EntityFrameworkCore/ConnectionStrings/MySqlConnectionStringChecker.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo/Abp/EntityFrameworkCore/ConnectionStrings/MySqlConnectionStringChecker.cs @@ -32,7 +32,7 @@ public class MySqlConnectionStringChecker : IConnectionStringChecker, ITransient return result; } - catch (Exception e) + catch (Exception) { return result; } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.Oracle.Devart/Volo/Abp/EntityFrameworkCore/ConnectionStrings/OracleDevartConnectionStringChecker.cs b/framework/src/Volo.Abp.EntityFrameworkCore.Oracle.Devart/Volo/Abp/EntityFrameworkCore/ConnectionStrings/OracleDevartConnectionStringChecker.cs index 1bbc300ec8..c838b0c9aa 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.Oracle.Devart/Volo/Abp/EntityFrameworkCore/ConnectionStrings/OracleDevartConnectionStringChecker.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.Oracle.Devart/Volo/Abp/EntityFrameworkCore/ConnectionStrings/OracleDevartConnectionStringChecker.cs @@ -28,7 +28,7 @@ public class OracleDevartConnectionStringChecker : IConnectionStringChecker, ITr return result; } - catch (Exception e) + catch (Exception) { return result; } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/ConnectionStrings/OracleConnectionStringChecker.cs b/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/ConnectionStrings/OracleConnectionStringChecker.cs index 1176a9ce64..7ecc70d986 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/ConnectionStrings/OracleConnectionStringChecker.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/ConnectionStrings/OracleConnectionStringChecker.cs @@ -28,7 +28,7 @@ public class OracleConnectionStringChecker : IConnectionStringChecker, ITransien return result; } - catch (Exception e) + catch (Exception) { return result; } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/ConnectionStrings/NpgsqlConnectionStringChecker.cs b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/ConnectionStrings/NpgsqlConnectionStringChecker.cs index 56e47aa2d4..f6c8392da5 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/ConnectionStrings/NpgsqlConnectionStringChecker.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/ConnectionStrings/NpgsqlConnectionStringChecker.cs @@ -32,7 +32,7 @@ public class NpgsqlConnectionStringChecker : IConnectionStringChecker, ITransien return result; } - catch (Exception e) + catch (Exception) { return result; } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.SqlServer/Volo/Abp/EntityFrameworkCore/ConnectionStrings/SqlServerConnectionStringChecker.cs b/framework/src/Volo.Abp.EntityFrameworkCore.SqlServer/Volo/Abp/EntityFrameworkCore/ConnectionStrings/SqlServerConnectionStringChecker.cs index 668aec3d96..6b84e69024 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.SqlServer/Volo/Abp/EntityFrameworkCore/ConnectionStrings/SqlServerConnectionStringChecker.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.SqlServer/Volo/Abp/EntityFrameworkCore/ConnectionStrings/SqlServerConnectionStringChecker.cs @@ -32,7 +32,7 @@ public class SqlServerConnectionStringChecker : IConnectionStringChecker, ITrans return result; } - catch (Exception e) + catch (Exception) { return result; } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.Sqlite/Volo/Abp/EntityFrameworkCore/ConnectionStrings/SqliteConnectionStringChecker.cs b/framework/src/Volo.Abp.EntityFrameworkCore.Sqlite/Volo/Abp/EntityFrameworkCore/ConnectionStrings/SqliteConnectionStringChecker.cs index 48b428ce8f..4697f7e0b2 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.Sqlite/Volo/Abp/EntityFrameworkCore/ConnectionStrings/SqliteConnectionStringChecker.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.Sqlite/Volo/Abp/EntityFrameworkCore/ConnectionStrings/SqliteConnectionStringChecker.cs @@ -24,7 +24,7 @@ public class SqliteConnectionStringChecker : IConnectionStringChecker, ITransien return result; } - catch (Exception e) + catch (Exception) { return result; } diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs index 17d497f883..bbb1e27f3b 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs @@ -224,7 +224,7 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB { await LocalEventBus.PublishAsync(distributedEvent); } - catch (Exception _) + catch (Exception) { // ignored } @@ -236,7 +236,7 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB { await LocalEventBus.PublishAsync(distributedEvent); } - catch (Exception _) + catch (Exception) { // ignored } diff --git a/framework/src/Volo.Abp.Guids/Volo/Abp/Guids/SequentialGuidType.cs b/framework/src/Volo.Abp.Guids/Volo/Abp/Guids/SequentialGuidType.cs index f9c4095ac2..5e0609fd7f 100644 --- a/framework/src/Volo.Abp.Guids/Volo/Abp/Guids/SequentialGuidType.cs +++ b/framework/src/Volo.Abp.Guids/Volo/Abp/Guids/SequentialGuidType.cs @@ -1,4 +1,6 @@ -namespace Volo.Abp.Guids; +using System; + +namespace Volo.Abp.Guids; /// /// Describes the type of a sequential GUID value. @@ -12,7 +14,7 @@ public enum SequentialGuidType SequentialAsString, /// - /// The GUID should be sequential when formatted using the method. + /// The GUID should be sequential when formatted using the method. /// Used by Oracle. /// SequentialAsBinary, diff --git a/framework/src/Volo.Abp.Json.Newtonsoft/Volo/Abp/Json/Newtonsoft/AbpNewtonsoftJsonSerializer.cs b/framework/src/Volo.Abp.Json.Newtonsoft/Volo/Abp/Json/Newtonsoft/AbpNewtonsoftJsonSerializer.cs index 2a21f5fbd7..0450064f2f 100644 --- a/framework/src/Volo.Abp.Json.Newtonsoft/Volo/Abp/Json/Newtonsoft/AbpNewtonsoftJsonSerializer.cs +++ b/framework/src/Volo.Abp.Json.Newtonsoft/Volo/Abp/Json/Newtonsoft/AbpNewtonsoftJsonSerializer.cs @@ -45,6 +45,7 @@ public class AbpNewtonsoftJsonSerializer : IJsonSerializer, ITransientDependency indented }, _ => { +#pragma warning disable CS0618 // Type or member is obsolete var settings = new JsonSerializerSettings { Binder = Options.Value.JsonSerializerSettings.Binder, @@ -80,6 +81,7 @@ public class AbpNewtonsoftJsonSerializer : IJsonSerializer, ITransientDependency TypeNameHandling = Options.Value.JsonSerializerSettings.TypeNameHandling, TypeNameAssemblyFormatHandling = Options.Value.JsonSerializerSettings.TypeNameAssemblyFormatHandling }; +#pragma warning restore CS0618 // Type or member is obsolete if (!camelCase) { diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/ConnectionStrings/MongoDBConnectionStringChecker.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/ConnectionStrings/MongoDBConnectionStringChecker.cs index f77335f285..bae06df072 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/ConnectionStrings/MongoDBConnectionStringChecker.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/ConnectionStrings/MongoDBConnectionStringChecker.cs @@ -22,7 +22,7 @@ public class MongoDBConnectionStringChecker : IConnectionStringChecker, ITransie DatabaseExists = true }); } - catch (Exception e) + catch (Exception) { return Task.FromResult(new AbpConnectionStringCheckResult()); } diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/UnitOfWorkMongoDbContextProvider.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/UnitOfWorkMongoDbContextProvider.cs index 04d4e0bfa5..1585bc1332 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/UnitOfWorkMongoDbContextProvider.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/UnitOfWorkMongoDbContextProvider.cs @@ -242,7 +242,7 @@ public class UnitOfWorkMongoDbContextProvider : IMongoDbContext { session.StartTransaction(); } - catch (NotSupportedException e) + catch (NotSupportedException) { Logger.LogWarning(TransactionsNotSupportedWarningMessage); diff --git a/framework/src/Volo.Abp.ObjectMapping/Volo/Abp/ObjectMapping/IObjectMapper.cs b/framework/src/Volo.Abp.ObjectMapping/Volo/Abp/ObjectMapping/IObjectMapper.cs index 9801de4543..c0f235c848 100644 --- a/framework/src/Volo.Abp.ObjectMapping/Volo/Abp/ObjectMapping/IObjectMapper.cs +++ b/framework/src/Volo.Abp.ObjectMapping/Volo/Abp/ObjectMapping/IObjectMapper.cs @@ -11,7 +11,7 @@ public interface IObjectMapper IAutoObjectMappingProvider AutoObjectMappingProvider { get; } /// - /// Converts an object to another. Creates a new object of . + /// Converts an object to another. Creates a new object of . /// /// Type of the destination object /// Type of the source object @@ -25,7 +25,7 @@ public interface IObjectMapper /// Destination type /// Source object /// Destination object - /// Returns the same object after mapping operation + /// Returns the same object after mapping operation TDestination Map(TSource source, TDestination destination); } @@ -46,7 +46,7 @@ public interface IObjectMapper : IObjectMapper public interface IObjectMapper { /// - /// Converts an object to another. Creates a new object of . + /// Converts an object to another. Creates a new object of . /// /// Source object TDestination Map(TSource source); @@ -56,6 +56,6 @@ public interface IObjectMapper /// /// Source object /// Destination object - /// Returns the same object after mapping operation + /// Returns the same object after mapping operation TDestination Map(TSource source, TDestination destination); } diff --git a/framework/src/Volo.Abp.TextTemplating.Core/Volo/Abp/TextTemplating/TemplateDefinition.cs b/framework/src/Volo.Abp.TextTemplating.Core/Volo/Abp/TextTemplating/TemplateDefinition.cs index a371fc3a9a..da15bb31ab 100644 --- a/framework/src/Volo.Abp.TextTemplating.Core/Volo/Abp/TextTemplating/TemplateDefinition.cs +++ b/framework/src/Volo.Abp.TextTemplating.Core/Volo/Abp/TextTemplating/TemplateDefinition.cs @@ -39,8 +39,8 @@ public class TemplateDefinition : IHasNameWithLocalizableDisplayName /// /// Name of the property /// - /// Returns the value in the dictionary by given . - /// Returns null if given is not present in the dictionary. + /// Returns the value in the dictionary by given . + /// Returns null if given is not present in the dictionary. /// public object? this[string name] { get => Properties.GetOrDefault(name); diff --git a/framework/src/Volo.Abp.TextTemplating.Razor/Volo/Abp/TextTemplating/Razor/EmptyProjectFileSystem.cs b/framework/src/Volo.Abp.TextTemplating.Razor/Volo/Abp/TextTemplating/Razor/EmptyProjectFileSystem.cs index 8c8d8703dd..c8bebc5d88 100644 --- a/framework/src/Volo.Abp.TextTemplating.Razor/Volo/Abp/TextTemplating/Razor/EmptyProjectFileSystem.cs +++ b/framework/src/Volo.Abp.TextTemplating.Razor/Volo/Abp/TextTemplating/Razor/EmptyProjectFileSystem.cs @@ -12,11 +12,13 @@ internal class EmptyProjectFileSystem : RazorProjectFileSystem public override IEnumerable EnumerateItems(string basePath) { NormalizeAndEnsureValidPath(basePath); - return Enumerable.Empty(); + return []; } [Obsolete("Use GetItem(string path, string fileKind) instead.")] +#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member public override RazorProjectItem GetItem(string path) +#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member { return GetItem(path, fileKind: null); } diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs index 0c42a15c5e..ae240cdbba 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs @@ -126,6 +126,7 @@ public class ApplicationMenuItem : IHasMenuItems, IHasSimpleStateCheckers>(); Items = new ApplicationMenuItemList(); + } /// diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController.cs index 5efebb4603..0993293dc3 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController.cs @@ -1,6 +1,7 @@ using System.IO; using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Shouldly; using Volo.Abp.Content; @@ -27,7 +28,7 @@ public class RemoteStreamContentTestController : AbpController var memoryStream = new MemoryStream(); await memoryStream.WriteAsync(Encoding.UTF8.GetBytes("DownloadAsync")); memoryStream.Position = 0; - Response.Headers.Add("Content-Disposition", "attachment; filename=myDownload.rtf"); + Response.Headers.Append("Content-Disposition", "attachment; filename=myDownload.rtf"); return new RemoteStreamContent(memoryStream, "download.rtf", "application/rtf"); } diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs index d94eb42e2f..fbbac40844 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs @@ -14,8 +14,6 @@ namespace Volo.Abp.TestApp.EntityFrameworkCore; [ReplaceDbContext(typeof(IFourthDbContext))] public class TestAppDbContext : AbpDbContext, IThirdDbContext, IFourthDbContext { - private DbSet _dummyEntities; - private DbSet _dummyEntities1; public DbSet People { get; set; } public DbSet Cities { get; set; } From e5afdd1fe0b951971ef7cccf5e3b83558f969f4d Mon Sep 17 00:00:00 2001 From: Mark Cilia Vincenti Date: Fri, 16 Aug 2024 12:00:57 +0200 Subject: [PATCH 2/3] More fixes. --- .../ExceptionHandling/AbpExceptionFilter.cs | 2 +- .../AbpExceptionPageFilter.cs | 2 +- .../Commands/ProjectCreationCommandBase.cs | 6 +- .../Volo/Abp/Cli/Commands/TranslateCommand.cs | 2 +- .../Cli/ProjectBuilding/Files/FileEntry.cs | 2 + .../ProjectModification/NpmPackagesUpdater.cs | 6 +- .../ProjectNugetPackageAdder.cs | 4 +- .../SolutionModuleAdder.cs | 2 +- .../Encryption/StringEncryptionService.cs | 108 ++++++------------ 9 files changed, 50 insertions(+), 84 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionFilter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionFilter.cs index d2abae0902..a9131b91ff 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionFilter.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionFilter.cs @@ -75,7 +75,7 @@ public class AbpExceptionFilter : IAsyncExceptionFilter, IAbpFilter, ITransientD } else { - context.HttpContext.Response.Headers.Add(AbpHttpConsts.AbpErrorFormat, "true"); + context.HttpContext.Response.Headers.Append(AbpHttpConsts.AbpErrorFormat, "true"); context.HttpContext.Response.StatusCode = (int)context .GetRequiredService() .GetStatusCode(context.HttpContext, context.Exception); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionPageFilter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionPageFilter.cs index f404f52e5d..b7c443b583 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionPageFilter.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionPageFilter.cs @@ -103,7 +103,7 @@ public class AbpExceptionPageFilter : IAsyncPageFilter, IAbpFilter, ITransientDe } else { - context.HttpContext.Response.Headers.Add(AbpHttpConsts.AbpErrorFormat, "true"); + context.HttpContext.Response.Headers.Append(AbpHttpConsts.AbpErrorFormat, "true"); context.HttpContext.Response.StatusCode = (int)context .GetRequiredService() .GetStatusCode(context.HttpContext, context.Exception!); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs index 335f5faef4..8ee57440e2 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs @@ -309,10 +309,7 @@ public abstract class ProjectCreationCommandBase bool isTiered, CommandLineArgs commandLineArgs) { - -#if DEBUG - return; -#endif +#if !DEBUG if (AppTemplateBase.IsAppTemplate(template)) { var isCommercial = template == AppProTemplate.TemplateName; @@ -322,6 +319,7 @@ public abstract class ProjectCreationCommandBase { OpenMicroserviceDocumentPage(); } +#endif } protected UiFramework FindMicroserviceSolutionUiFramework(string outputFolderRoot) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs index f1482d5a85..0bf89db5c0 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs @@ -490,7 +490,7 @@ public class TranslateCommand : IConsoleCommand, ITransientDependency var jsonString = File.ReadAllText(jsonFile); _ = JsonLocalizationDictionaryBuilder.BuildFromJsonString(jsonString); } - catch (Exception e) + catch (Exception) { Logger.LogError($"Invalid json file: {jsonFile}"); hasInvalidJsonFile = true; diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntry.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntry.cs index c634f09fa8..6d3c261799 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntry.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntry.cs @@ -97,7 +97,9 @@ public class FileEntry if (Bytes[0] == 0x2b && Bytes[1] == 0x2f && Bytes[2] == 0x76) { +#pragma warning disable SYSLIB0001 // The UTF-7 encoding is insecure return Encoding.UTF7; +#pragma warning restore SYSLIB0001 // The UTF-7 encoding is insecure } if (Bytes[0] == 0xef && Bytes[1] == 0xbb && Bytes[2] == 0xbf) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs index fa47442514..019feb93d0 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs @@ -54,7 +54,7 @@ public class NpmPackagesUpdater : ITransientDependency { var fileList = _packageJsonFileFinder.Find(rootDirectory); - if (!fileList.Any()) + if (fileList.Count == 0) { return; } @@ -95,8 +95,8 @@ public class NpmPackagesUpdater : ITransientDependency if (!IsAngularProject(fileDirectory)) { - Thread.Sleep(1000); - RunInstallLibsAsync(fileDirectory); + await Task.Delay(1000); + await RunInstallLibsAsync(fileDirectory); } } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs index b0fde75ca5..9d9d7e159e 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs @@ -259,11 +259,11 @@ public class ProjectNugetPackageAdder : ITransientDependency if (useDotnetCliToInstall) { - AddUsingDotnetCli(package, version); + await AddUsingDotnetCli(package, version); } else { - AddToCsprojManuallyAsync(projectFile, package, version); + await AddToCsprojManuallyAsync(projectFile, package, version); } var moduleFiles = ModuleClassFinder.Find(projectFile, "AbpModule"); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs index ed5b40f717..abf0b1750a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs @@ -391,7 +391,7 @@ public class SolutionModuleAdder : ITransientDependency continue; } - RemoveProjectFromSolutionAsync(moduleSolutionFile, projectToRemove); + await RemoveProjectFromSolutionAsync(moduleSolutionFile, projectToRemove); } } diff --git a/framework/src/Volo.Abp.Security/Volo/Abp/Security/Encryption/StringEncryptionService.cs b/framework/src/Volo.Abp.Security/Volo/Abp/Security/Encryption/StringEncryptionService.cs index e1e7e94b7a..c2fb7d8c9e 100644 --- a/framework/src/Volo.Abp.Security/Volo/Abp/Security/Encryption/StringEncryptionService.cs +++ b/framework/src/Volo.Abp.Security/Volo/Abp/Security/Encryption/StringEncryptionService.cs @@ -26,38 +26,21 @@ public class StringEncryptionService : IStringEncryptionService, ITransientDepen return null; } - if (passPhrase == null) - { - passPhrase = Options.DefaultPassPhrase; - } - - if (salt == null) - { - salt = Options.DefaultSalt; - } + passPhrase ??= Options.DefaultPassPhrase; + salt ??= Options.DefaultSalt; var plainTextBytes = Encoding.UTF8.GetBytes(plainText); - using (var password = new Rfc2898DeriveBytes(passPhrase, salt)) - { - var keyBytes = password.GetBytes(Options.Keysize / 8); - using (var symmetricKey = Aes.Create()) - { - symmetricKey.Mode = CipherMode.CBC; - using (var encryptor = symmetricKey.CreateEncryptor(keyBytes, Options.InitVectorBytes)) - { - using (var memoryStream = new MemoryStream()) - { - using (var cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write)) - { - cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length); - cryptoStream.FlushFinalBlock(); - var cipherTextBytes = memoryStream.ToArray(); - return Convert.ToBase64String(cipherTextBytes); - } - } - } - } - } + using var password = new Rfc2898DeriveBytes(passPhrase, salt); + var keyBytes = password.GetBytes(Options.Keysize / 8); + using var symmetricKey = Aes.Create(); + symmetricKey.Mode = CipherMode.CBC; + using var encryptor = symmetricKey.CreateEncryptor(keyBytes, Options.InitVectorBytes); + using var memoryStream = new MemoryStream(); + using var cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write); + cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length); + cryptoStream.FlushFinalBlock(); + var cipherTextBytes = memoryStream.ToArray(); + return Convert.ToBase64String(cipherTextBytes); } public virtual string? Decrypt(string? cipherText, string? passPhrase = null, byte[]? salt = null) @@ -67,53 +50,36 @@ public class StringEncryptionService : IStringEncryptionService, ITransientDepen return null; } - if (passPhrase == null) - { - passPhrase = Options.DefaultPassPhrase; - } - - if (salt == null) - { - salt = Options.DefaultSalt; - } + passPhrase ??= Options.DefaultPassPhrase; + salt ??= Options.DefaultSalt; var cipherTextBytes = Convert.FromBase64String(cipherText); - using (var password = new Rfc2898DeriveBytes(passPhrase, salt)) + using var password = new Rfc2898DeriveBytes(passPhrase, salt); + var keyBytes = password.GetBytes(Options.Keysize / 8); + using var symmetricKey = Aes.Create(); + symmetricKey.Mode = CipherMode.CBC; + using var decryptor = symmetricKey.CreateDecryptor(keyBytes, Options.InitVectorBytes); + using var memoryStream = new MemoryStream(cipherTextBytes); + using var cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read); + var plainTextBytes = new byte[cipherTextBytes.Length]; + var totalReadCount = 0; + while (totalReadCount < cipherTextBytes.Length) { - var keyBytes = password.GetBytes(Options.Keysize / 8); - using (var symmetricKey = Aes.Create()) + var buffer = new byte[cipherTextBytes.Length]; + var readCount = cryptoStream.Read(buffer, 0, buffer.Length); + if (readCount == 0) { - symmetricKey.Mode = CipherMode.CBC; - using (var decryptor = symmetricKey.CreateDecryptor(keyBytes, Options.InitVectorBytes)) - { - using (var memoryStream = new MemoryStream(cipherTextBytes)) - { - using (var cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read)) - { - var plainTextBytes = new byte[cipherTextBytes.Length]; - var totalReadCount = 0; - while (totalReadCount < cipherTextBytes.Length) - { - var buffer = new byte[cipherTextBytes.Length]; - var readCount = cryptoStream.Read(buffer, 0, buffer.Length); - if (readCount == 0) - { - break; - } - - for (var i = 0; i < readCount; i++) - { - plainTextBytes[i + totalReadCount] = buffer[i]; - } - - totalReadCount += readCount; - } + break; + } - return Encoding.UTF8.GetString(plainTextBytes, 0, totalReadCount); - } - } - } + for (var i = 0; i < readCount; i++) + { + plainTextBytes[i + totalReadCount] = buffer[i]; } + + totalReadCount += readCount; } + + return Encoding.UTF8.GetString(plainTextBytes, 0, totalReadCount); } } From 3b6262820522793d6a2ecea754fab3f17f35256e Mon Sep 17 00:00:00 2001 From: Mark Cilia Vincenti Date: Fri, 16 Aug 2024 17:24:06 +0200 Subject: [PATCH 3/3] Undo unnecessary change --- .../Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs index ae240cdbba..65df0d2181 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs @@ -125,8 +125,7 @@ public class ApplicationMenuItem : IHasMenuItems, IHasSimpleStateCheckers>(); - Items = new ApplicationMenuItemList(); - + Items = new ApplicationMenuItemList(); } ///