Browse Source

Merge pull request #20539 from MarkCiliaVincenti/cleaning

Cleaning up warnings.
pull/21074/head
maliming 2 years ago
committed by GitHub
parent
commit
ffe9d820b9
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs
  2. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionFilter.cs
  3. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionPageFilter.cs
  4. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowActionFilter.cs
  5. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowPageFilter.cs
  6. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Validation/ValidationAttributeHelper.cs
  7. 4
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpExceptionHandlingMiddleware.cs
  8. 1
      framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionContext.cs
  9. 2
      framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor
  10. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
  11. 26
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs
  12. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/DotnetEfToolManager.cs
  13. 4
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs
  14. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Files/FileEntry.cs
  15. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs
  16. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNugetPackageAdder.cs
  17. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs
  18. 8
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/IAbpCommonDbContextRegistrationOptionsBuilder.cs
  19. 4
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRootWithUser.cs
  20. 4
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRootWithUser.cs
  21. 2
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntityWithUser.cs
  22. 2
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntityWithUser.cs
  23. 2
      framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs
  24. 2
      framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo/Abp/EntityFrameworkCore/ConnectionStrings/MySqlConnectionStringChecker.cs
  25. 2
      framework/src/Volo.Abp.EntityFrameworkCore.Oracle.Devart/Volo/Abp/EntityFrameworkCore/ConnectionStrings/OracleDevartConnectionStringChecker.cs
  26. 2
      framework/src/Volo.Abp.EntityFrameworkCore.Oracle/Volo/Abp/EntityFrameworkCore/ConnectionStrings/OracleConnectionStringChecker.cs
  27. 2
      framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/ConnectionStrings/NpgsqlConnectionStringChecker.cs
  28. 2
      framework/src/Volo.Abp.EntityFrameworkCore.SqlServer/Volo/Abp/EntityFrameworkCore/ConnectionStrings/SqlServerConnectionStringChecker.cs
  29. 2
      framework/src/Volo.Abp.EntityFrameworkCore.Sqlite/Volo/Abp/EntityFrameworkCore/ConnectionStrings/SqliteConnectionStringChecker.cs
  30. 4
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs
  31. 6
      framework/src/Volo.Abp.Guids/Volo/Abp/Guids/SequentialGuidType.cs
  32. 2
      framework/src/Volo.Abp.Json.Newtonsoft/Volo/Abp/Json/Newtonsoft/AbpNewtonsoftJsonSerializer.cs
  33. 2
      framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/ConnectionStrings/MongoDBConnectionStringChecker.cs
  34. 2
      framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/UnitOfWorkMongoDbContextProvider.cs
  35. 8
      framework/src/Volo.Abp.ObjectMapping/Volo/Abp/ObjectMapping/IObjectMapper.cs
  36. 108
      framework/src/Volo.Abp.Security/Volo/Abp/Security/Encryption/StringEncryptionService.cs
  37. 4
      framework/src/Volo.Abp.TextTemplating.Core/Volo/Abp/TextTemplating/TemplateDefinition.cs
  38. 4
      framework/src/Volo.Abp.TextTemplating.Razor/Volo/Abp/TextTemplating/Razor/EmptyProjectFileSystem.cs
  39. 2
      framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs
  40. 3
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController.cs
  41. 2
      framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs

6
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs

@ -364,12 +364,14 @@ public abstract class AbpDatePickerBaseTagHelperService<TTagHelper> : 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);
}

2
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionFilter.cs

@ -77,7 +77,7 @@ public class AbpExceptionFilter : IAsyncExceptionFilter, IAbpFilter, ITransientD
{
if (!context.HttpContext.Response.HasStarted)
{
context.HttpContext.Response.Headers.Add(AbpHttpConsts.AbpErrorFormat, "true");
context.HttpContext.Response.Headers.Append(AbpHttpConsts.AbpErrorFormat, "true");
context.HttpContext.Response.StatusCode = (int)context
.GetRequiredService<IHttpExceptionStatusCodeFinder>()
.GetStatusCode(context.HttpContext, context.Exception);

2
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ExceptionHandling/AbpExceptionPageFilter.cs

@ -106,7 +106,7 @@ public class AbpExceptionPageFilter : IAsyncPageFilter, IAbpFilter, ITransientDe
{
if (!context.HttpContext.Response.HasStarted)
{
context.HttpContext.Response.Headers.Add(AbpHttpConsts.AbpErrorFormat, "true");
context.HttpContext.Response.Headers.Append(AbpHttpConsts.AbpErrorFormat, "true");
context.HttpContext.Response.StatusCode = (int)context
.GetRequiredService<IHttpExceptionStatusCodeFinder>()
.GetStatusCode(context.HttpContext, context.Exception!);

2
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowActionFilter.cs

@ -106,7 +106,7 @@ public class AbpUowActionFilter : IAsyncActionFilter, IAbpFilter, ITransientDepe
{
await currentUow.SaveChangesAsync(cancellationToken);
}
catch (Exception e)
catch (Exception)
{
await currentUow.RollbackAsync(cancellationToken);
throw;

2
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Uow/AbpUowPageFilter.cs

@ -112,7 +112,7 @@ public class AbpUowPageFilter : IAsyncPageFilter, IAbpFilter, ITransientDependen
{
await currentUow.SaveChangesAsync(cancellationToken);
}
catch (Exception e)
catch (Exception)
{
await currentUow.RollbackAsync(cancellationToken);
throw;

2
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
}

4
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(

1
framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionContext.cs

@ -32,7 +32,6 @@ public interface IPermissionDefinitionContext
/// Throws <see cref="AbpException"/> if there is a group with the name.
/// <param name="name">Name of the group</param>
/// <param name="displayName">Localized display name of the group</param>
/// <param name="multiTenancySide">Select a multi-tenancy side</param>
/// </summary>
PermissionGroupDefinition AddGroup(
[NotNull] string name,

2
framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor

@ -1 +1 @@
<SnackbarStack @ref="SnackbarStack" Location="SnackbarStackLocation.End" Multiline="true" DelayCloseOnClick="true" DelayCloseOnClickInterval="10000" Closed="@OnSnackbarClosed" />
<SnackbarStack @ref="SnackbarStack" Location="SnackbarStackLocation.BottomEnd" Multiline="true" DelayCloseOnClick="true" DelayCloseOnClickInterval="10000" Closed="@OnSnackbarClosed" />

2
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
}

26
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, template);
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 &&
@ -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)

8
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()

4
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;
}
@ -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;

2
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)

6
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);
}
}
}

6
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");
@ -291,7 +291,7 @@ public class ProjectNugetPackageAdder : ITransientDependency
{
await RunBundleForBlazorAsync(projectFile);
}
catch (Exception e)
catch (Exception)
{
Logger.LogWarning("Couldn't run bundle for blazor.");
}

2
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);
}
}

8
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/IAbpCommonDbContextRegistrationOptionsBuilder.cs

@ -20,23 +20,23 @@ public interface IAbpCommonDbContextRegistrationOptionsBuilder
/// <summary>
/// Registers default repositories for all the entities in this DbContext.
/// Default repositories will use given <see cref="TDefaultRepositoryDbContext"/>.
/// Default repositories will use given <typeparamref name="TDefaultRepositoryDbContext"/>.
/// </summary>
/// <typeparam name="TDefaultRepositoryDbContext">DbContext type that will be used by default repositories</typeparam>
/// <param name="includeAllEntities">
/// Registers repositories only for aggregate root entities by default.
/// Set <see cref="includeAllEntities"/> to true to include all entities.
/// Set <paramref name="includeAllEntities"/> to true to include all entities.
/// </param>
IAbpCommonDbContextRegistrationOptionsBuilder AddDefaultRepositories<TDefaultRepositoryDbContext>(bool includeAllEntities = false);
/// <summary>
/// Registers default repositories for all the entities in this DbContext.
/// Default repositories will use given <see cref="defaultRepositoryDbContextType"/>.
/// Default repositories will use given <paramref name="defaultRepositoryDbContextType"/>.
/// </summary>
/// <param name="defaultRepositoryDbContextType">DbContext type that will be used by default repositories</param>
/// <param name="includeAllEntities">
/// Registers repositories only for aggregate root entities by default.
/// Set <see cref="includeAllEntities"/> to true to include all entities.
/// Set <paramref name="includeAllEntities"/> to true to include all entities.
/// </param>
IAbpCommonDbContextRegistrationOptionsBuilder AddDefaultRepositories(Type defaultRepositoryDbContextType, bool includeAllEntities = false);

4
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;
/// <summary>
/// This class can be used to simplify implementing <see cref="IAuditedObjectObject{TUser}"/> for aggregate roots.
/// This class can be used to simplify implementing <see cref="IAuditedObject{TUser}"/> for aggregate roots.
/// </summary>
/// <typeparam name="TUser">Type of the user</typeparam>
[Serializable]
@ -19,7 +19,7 @@ public abstract class AuditedAggregateRootWithUser<TUser> : AuditedAggregateRoot
}
/// <summary>
/// This class can be used to simplify implementing <see cref="IAuditedObjectObject{TUser}"/> for aggregate roots.
/// This class can be used to simplify implementing <see cref="IAuditedObject{TUser}"/> for aggregate roots.
/// </summary>
/// <typeparam name="TKey">Type of the primary key of the entity</typeparam>
/// <typeparam name="TUser">Type of the user</typeparam>

4
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;
/// <summary>
/// This class can be used to simplify implementing <see cref="ICreationAuditedObjectObject{TCreator}"/> for aggregate roots.
/// This class can be used to simplify implementing <see cref="ICreationAuditedObject{TCreator}"/> for aggregate roots.
/// </summary>
/// <typeparam name="TUser">Type of the user</typeparam>
[Serializable]
@ -15,7 +15,7 @@ public abstract class CreationAuditedAggregateRootWithUser<TUser> : CreationAudi
}
/// <summary>
/// This class can be used to simplify implementing <see cref="ICreationAuditedObjectObject{TCreator}"/> for aggregate roots.
/// This class can be used to simplify implementing <see cref="ICreationAuditedObject{TCreator}"/> for aggregate roots.
/// </summary>
/// <typeparam name="TKey">Type of the primary key of the entity</typeparam>
/// <typeparam name="TUser">Type of the user</typeparam>

2
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntityWithUser.cs

@ -15,7 +15,7 @@ public abstract class CreationAuditedEntityWithUser<TUser> : CreationAuditedEnti
}
/// <summary>
/// This class can be used to simplify implementing <see cref="ICreationAuditedObjectObject{TCreator}"/>.
/// This class can be used to simplify implementing <see cref="ICreationAuditedObject{TCreator}"/>.
/// </summary>
/// <typeparam name="TKey">Type of the primary key of the entity</typeparam>
/// <typeparam name="TUser">Type of the user</typeparam>

2
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntityWithUser.cs

@ -22,7 +22,7 @@ public abstract class FullAuditedEntityWithUser<TUser> : FullAuditedEntity, IFul
}
/// <summary>
/// Implements <see cref="IFullAuditedObjectObject{TUser}"/> to be a base class for full-audited entities.
/// Implements <see cref="IFullAuditedObject{TUser}"/> to be a base class for full-audited entities.
/// </summary>
/// <typeparam name="TKey">Type of the primary key of the entity</typeparam>
/// <typeparam name="TUser">Type of the user</typeparam>

2
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
{

2
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;
}

2
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;
}

2
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;
}

2
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;
}

2
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;
}

2
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;
}

4
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
}

6
framework/src/Volo.Abp.Guids/Volo/Abp/Guids/SequentialGuidType.cs

@ -1,4 +1,6 @@
namespace Volo.Abp.Guids;
using System;
namespace Volo.Abp.Guids;
/// <summary>
/// Describes the type of a sequential GUID value.
@ -12,7 +14,7 @@ public enum SequentialGuidType
SequentialAsString,
/// <summary>
/// The GUID should be sequential when formatted using the <see cref="Guid.ToByteArray" /> method.
/// The GUID should be sequential when formatted using the <see cref="Guid.ToByteArray()" /> method.
/// Used by Oracle.
/// </summary>
SequentialAsBinary,

2
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)
{

2
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());
}

2
framework/src/Volo.Abp.MongoDB/Volo/Abp/Uow/MongoDB/UnitOfWorkMongoDbContextProvider.cs

@ -242,7 +242,7 @@ public class UnitOfWorkMongoDbContextProvider<TMongoDbContext> : IMongoDbContext
{
session.StartTransaction();
}
catch (NotSupportedException e)
catch (NotSupportedException)
{
Logger.LogWarning(TransactionsNotSupportedWarningMessage);

8
framework/src/Volo.Abp.ObjectMapping/Volo/Abp/ObjectMapping/IObjectMapper.cs

@ -11,7 +11,7 @@ public interface IObjectMapper
IAutoObjectMappingProvider AutoObjectMappingProvider { get; }
/// <summary>
/// Converts an object to another. Creates a new object of <see cref="TDestination"/>.
/// Converts an object to another. Creates a new object of <typeparamref name="TDestination" />.
/// </summary>
/// <typeparam name="TDestination">Type of the destination object</typeparam>
/// <typeparam name="TSource">Type of the source object</typeparam>
@ -25,7 +25,7 @@ public interface IObjectMapper
/// <typeparam name="TDestination">Destination type</typeparam>
/// <param name="source">Source object</param>
/// <param name="destination">Destination object</param>
/// <returns>Returns the same <see cref="destination"/> object after mapping operation</returns>
/// <returns>Returns the same <paramref name="destination" /> object after mapping operation</returns>
TDestination Map<TSource, TDestination>(TSource source, TDestination destination);
}
@ -46,7 +46,7 @@ public interface IObjectMapper<TContext> : IObjectMapper
public interface IObjectMapper<in TSource, TDestination>
{
/// <summary>
/// Converts an object to another. Creates a new object of <see cref="TDestination"/>.
/// Converts an object to another. Creates a new object of <typeparamref name="TDestination"/>.
/// </summary>
/// <param name="source">Source object</param>
TDestination Map(TSource source);
@ -56,6 +56,6 @@ public interface IObjectMapper<in TSource, TDestination>
/// </summary>
/// <param name="source">Source object</param>
/// <param name="destination">Destination object</param>
/// <returns>Returns the same <see cref="destination"/> object after mapping operation</returns>
/// <returns>Returns the same <paramref name="destination"/> object after mapping operation</returns>
TDestination Map(TSource source, TDestination destination);
}

108
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);
}
}

4
framework/src/Volo.Abp.TextTemplating.Core/Volo/Abp/TextTemplating/TemplateDefinition.cs

@ -39,8 +39,8 @@ public class TemplateDefinition : IHasNameWithLocalizableDisplayName
/// </summary>
/// <param name="name">Name of the property</param>
/// <returns>
/// Returns the value in the <see cref="Properties"/> dictionary by given <see cref="name"/>.
/// Returns null if given <see cref="name"/> is not present in the <see cref="Properties"/> dictionary.
/// Returns the value in the <see cref="Properties"/> dictionary by given <paramref name="name"/>.
/// Returns null if given <paramref name="name"/> is not present in the <see cref="Properties"/> dictionary.
/// </returns>
public object? this[string name] {
get => Properties.GetOrDefault(name);

4
framework/src/Volo.Abp.TextTemplating.Razor/Volo/Abp/TextTemplating/Razor/EmptyProjectFileSystem.cs

@ -12,11 +12,13 @@ internal class EmptyProjectFileSystem : RazorProjectFileSystem
public override IEnumerable<RazorProjectItem> EnumerateItems(string basePath)
{
NormalizeAndEnsureValidPath(basePath);
return Enumerable.Empty<RazorProjectItem>();
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);
}

2
framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuItem.cs

@ -125,7 +125,7 @@ public class ApplicationMenuItem : IHasMenuItems, IHasSimpleStateCheckers<Applic
GroupName = groupName;
RequiredPermissionName = requiredPermissionName;
StateCheckers = new List<ISimpleStateChecker<ApplicationMenuItem>>();
Items = new ApplicationMenuItemList();
Items = new ApplicationMenuItemList();
}
/// <summary>

3
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");
}

2
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<TestAppDbContext>, IThirdDbContext, IFourthDbContext
{
private DbSet<FourthDbContextDummyEntity> _dummyEntities;
private DbSet<FourthDbContextDummyEntity> _dummyEntities1;
public DbSet<Person> People { get; set; }
public DbSet<City> Cities { get; set; }

Loading…
Cancel
Save