From 125fd39f0b11b7fe4d1392a37664085b3bc2dc55 Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Sun, 19 May 2024 22:02:59 +0300 Subject: [PATCH] Remove warnings related to CA1707 (#16101) Co-authored-by: Hisham Bin Ateya --- Directory.Build.props | 3 --- .../Services/AzureEmailProviderBase.cs | 4 ++-- .../PagerShapesTableProvider.cs | 2 ++ .../LuceneContentPickerShapeProvider.cs | 2 ++ .../ShapeFactoryExtensions.cs | 20 +++++++++---------- .../ElasticContentPickerShapeProvider.cs | 2 ++ .../OrchardCore.Abstractions.Tests.csproj | 6 ++---- .../OrchardCore.Benchmarks.csproj | 2 ++ .../OrchardCore.Tests.csproj | 2 ++ 9 files changed, 24 insertions(+), 19 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index e297bd9081f..f518024cb29 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -45,9 +45,6 @@ $(NoWarn);CA2201 - - $(NoWarn);CA1707 - $(NoWarn);CA1727 diff --git a/src/OrchardCore.Modules/OrchardCore.Email.Azure/Services/AzureEmailProviderBase.cs b/src/OrchardCore.Modules/OrchardCore.Email.Azure/Services/AzureEmailProviderBase.cs index 39e4329eb99..7e56dde13b4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Email.Azure/Services/AzureEmailProviderBase.cs +++ b/src/OrchardCore.Modules/OrchardCore.Email.Azure/Services/AzureEmailProviderBase.cs @@ -16,7 +16,7 @@ public abstract class AzureEmailProviderBase : IEmailProvider // Common supported file extensions and their corresponding MIME types for email attachments // using Azure Communication Services Email. // For more info - protected static readonly Dictionary _allowedMimeTypes = new() + protected static readonly Dictionary AllowedMimeTypes = new() { { ".3gp", "video/3gpp" }, { ".3g2", "video/3gpp2" }, @@ -206,7 +206,7 @@ private EmailMessage FromMailMessage(MailMessage message, Dictionary PagerAsync(this IShapeFactory _shapeFactory, Pager pager, int totalItemCount) - => _shapeFactory.CreateAsync(nameof(Pager), Arguments.From(new + public static ValueTask PagerAsync(this IShapeFactory shapeFactory, Pager pager, int totalItemCount) + => shapeFactory.CreateAsync(nameof(Pager), Arguments.From(new { pager.Page, pager.PageSize, TotalItemCount = totalItemCount, })); - public static async ValueTask PagerAsync(this IShapeFactory _shapeFactory, Pager pager, int totalItemCount, RouteData routeData) + public static async ValueTask PagerAsync(this IShapeFactory shapeFactory, Pager pager, int totalItemCount, RouteData routeData) { - var pagerShape = await _shapeFactory.PagerAsync(pager, totalItemCount); + var pagerShape = await shapeFactory.PagerAsync(pager, totalItemCount); if (routeData != null) { @@ -27,20 +27,20 @@ public static async ValueTask PagerAsync(this IShapeFactory _shapeFactor return pagerShape; } - public static ValueTask PagerAsync(this IShapeFactory _shapeFactory, Pager pager, int totalItemCount, RouteValueDictionary routeValues) - => _shapeFactory.PagerAsync(pager, totalItemCount, routeValues == null ? null : new RouteData(routeValues)); + public static ValueTask PagerAsync(this IShapeFactory shapeFactory, Pager pager, int totalItemCount, RouteValueDictionary routeValues) + => shapeFactory.PagerAsync(pager, totalItemCount, routeValues == null ? null : new RouteData(routeValues)); - public static ValueTask PagerSlimAsync(this IShapeFactory _shapeFactory, PagerSlim pager) - => _shapeFactory.CreateAsync(nameof(PagerSlim), Arguments.From(new + public static ValueTask PagerSlimAsync(this IShapeFactory shapeFactory, PagerSlim pager) + => shapeFactory.CreateAsync(nameof(PagerSlim), Arguments.From(new { pager.Before, pager.After, pager.PageSize, })); - public static async ValueTask PagerSlimAsync(this IShapeFactory _shapeFactory, PagerSlim pager, IDictionary values) + public static async ValueTask PagerSlimAsync(this IShapeFactory shapeFactory, PagerSlim pager, IDictionary values) { - var shape = await _shapeFactory.CreateAsync(nameof(PagerSlim), Arguments.From(new + var shape = await shapeFactory.CreateAsync(nameof(PagerSlim), Arguments.From(new { pager.Before, pager.After, diff --git a/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Shapes/ElasticContentPickerShapeProvider.cs b/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Shapes/ElasticContentPickerShapeProvider.cs index ef58bcf9be6..4f3f229fcb3 100644 --- a/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Shapes/ElasticContentPickerShapeProvider.cs +++ b/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Shapes/ElasticContentPickerShapeProvider.cs @@ -18,7 +18,9 @@ public ElasticContentPickerShapeProvider(IStringLocalizer $(CommonTargetFrameworks) OrchardCore + + $(NoWarn);CA1707 - - diff --git a/test/OrchardCore.Benchmarks/OrchardCore.Benchmarks.csproj b/test/OrchardCore.Benchmarks/OrchardCore.Benchmarks.csproj index 04cbbed1a4c..22ce21b4340 100644 --- a/test/OrchardCore.Benchmarks/OrchardCore.Benchmarks.csproj +++ b/test/OrchardCore.Benchmarks/OrchardCore.Benchmarks.csproj @@ -7,6 +7,8 @@ OrchardCore.Benchmark false Exe + + $(NoWarn);CA1707 diff --git a/test/OrchardCore.Tests/OrchardCore.Tests.csproj b/test/OrchardCore.Tests/OrchardCore.Tests.csproj index 28995c4eb9f..a11ad9ecb36 100644 --- a/test/OrchardCore.Tests/OrchardCore.Tests.csproj +++ b/test/OrchardCore.Tests/OrchardCore.Tests.csproj @@ -4,6 +4,8 @@ $(CommonTargetFrameworks) + + $(NoWarn);CA1707