Skip to content

Commit

Permalink
Cleaning up warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCiliaVincenti committed Aug 16, 2024
1 parent 252c528 commit de877d8
Show file tree
Hide file tree
Showing 36 changed files with 67 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,14 @@ protected TagHelperAttributeList ConvertDatePickerOptionsToAttributeList(IAbpDat
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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private async Task SaveChangesAsync(ActionExecutingContext context, IUnitOfWorkM
{
await currentUow.SaveChangesAsync(context.HttpContext.RequestAborted);
}
catch (Exception e)
catch (Exception)
{
await currentUow.RollbackAsync(context.HttpContext.RequestAborted);
throw;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private async Task SaveChangesAsync(PageHandlerExecutingContext context, IUnitOf
{
await currentUow.SaveChangesAsync(context.HttpContext.RequestAborted);
}
catch (Exception e)
catch (Exception)
{
await currentUow.RollbackAsync(context.HttpContext.RequestAborted);
throw;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static void SetDefaultErrorMessage(ValidationAttribute validationAttribut
var errorMessageString = ValidationAttributeErrorMessageStringProperty.GetValue(validationAttribute) as string;
validationAttribute.ErrorMessage = errorMessageString;
}
catch (Exception e)
catch (Exception)
{
// ignored
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ await httpContext.RequestServices.GetRequiredService<IAbpAuthorizationExceptionH
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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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" />
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private async Task CheckCreatedRequirements(ProjectBuildArgs projectArgs)
var redis = await ConnectionMultiplexer.ConnectAsync("127.0.0.1", options => options.ConnectTimeout = 3000);
isConnected = redis.IsConnected;
}
catch (Exception e)
catch (Exception)
{
// ignored
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected async Task<ProjectBuildArgs> GetProjectBuildArgsAsync(CommandLineArgs

if (version != null)
{
Logger.LogInformation("Version: " + version);
Logger.LogInformation($"Version: {version}");
}

var preview = commandLineArgs.Options.ContainsKey(Options.Preview.Long);
Expand Down Expand Up @@ -110,25 +110,25 @@ protected async Task<ProjectBuildArgs> GetProjectBuildArgsAsync(CommandLineArgs
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);
Expand All @@ -140,25 +140,25 @@ protected async Task<ProjectBuildArgs> GetProjectBuildArgsAsync(CommandLineArgs
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);
Expand Down Expand Up @@ -216,7 +216,7 @@ protected async Task<ProjectBuildArgs> GetProjectBuildArgsAsync(CommandLineArgs

IO.DirectoryHelper.CreateIfNotExists(outputFolder);

Logger.LogInformation("Output folder: " + outputFolder);
Logger.LogInformation($"Output folder: {outputFolder}");

if (connectionString == null &&
databaseManagementSystem != DatabaseManagementSystem.NotSpecified &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ public DotnetEfToolManager(ICmdHelper cmdHelper)

public async Task BeSureInstalledAsync()
{
if (IsDotNetEfToolInstalled())
if (!IsDotNetEfToolInstalled())
{
return;
}

InstallDotnetEfTool();
InstallDotnetEfTool();
}
}

private bool IsDotNetEfToolInstalled()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ private AbpLocalizationInfo GetAbpLocalizationInfoOrNull(string path)
{
jObject = JObject.Parse(json);
}
catch (Exception e)
catch (Exception)
{
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ protected virtual async Task AddAsPackageReference(string projectFile, NugetPack
{
await RunBundleForBlazorAsync(projectFile);
}
catch (Exception e)
catch (Exception)
{
Logger.LogWarning("Couldn't run bundle for blazor.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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]
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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]
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public virtual async Task<AbpConnectionStringCheckResult> CheckAsync(string conn

return result;
}
catch (Exception e)
catch (Exception)
{
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public virtual async Task<AbpConnectionStringCheckResult> CheckAsync(string conn

return result;
}
catch (Exception e)
catch (Exception)
{
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public virtual async Task<AbpConnectionStringCheckResult> CheckAsync(string conn

return result;
}
catch (Exception e)
catch (Exception)
{
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public virtual async Task<AbpConnectionStringCheckResult> CheckAsync(string conn

return result;
}
catch (Exception e)
catch (Exception)
{
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public virtual async Task<AbpConnectionStringCheckResult> CheckAsync(string conn

return result;
}
catch (Exception e)
catch (Exception)
{
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public virtual async Task<AbpConnectionStringCheckResult> CheckAsync(string conn

return result;
}
catch (Exception e)
catch (Exception)
{
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public virtual async Task TriggerDistributedEventSentAsync(DistributedEventSent
{
await LocalEventBus.PublishAsync(distributedEvent);
}
catch (Exception _)
catch (Exception)
{
// ignored
}
Expand All @@ -236,7 +236,7 @@ public virtual async Task TriggerDistributedEventReceivedAsync(DistributedEventR
{
await LocalEventBus.PublishAsync(distributedEvent);
}
catch (Exception _)
catch (Exception)
{
// ignored
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Volo.Abp.Guids;
using System;

namespace Volo.Abp.Guids;

/// <summary>
/// Describes the type of a sequential GUID value.
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected virtual JsonSerializerSettings CreateJsonSerializerOptions(bool camelC
indented
}, _ =>
{
#pragma warning disable CS0618 // Type or member is obsolete
var settings = new JsonSerializerSettings
{
Binder = Options.Value.JsonSerializerSettings.Binder,
Expand Down Expand Up @@ -80,6 +81,7 @@ protected virtual JsonSerializerSettings CreateJsonSerializerOptions(bool camelC
TypeNameHandling = Options.Value.JsonSerializerSettings.TypeNameHandling,
TypeNameAssemblyFormatHandling = Options.Value.JsonSerializerSettings.TypeNameAssemblyFormatHandling
};
#pragma warning restore CS0618 // Type or member is obsolete

if (!camelCase)
{
Expand Down
Loading

0 comments on commit de877d8

Please sign in to comment.