From 7618b47c86a0b80ec2dd6f00d81c5f54c17e82d3 Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Fri, 5 Apr 2024 23:38:16 +0300 Subject: [PATCH] Seal private and internal types (#15668) --- .../AdminPageRouteModelProvider.cs | 2 +- .../AliasPartContentHandleProvider.cs | 2 +- .../Services/AlwaysHasChangedToken.cs | 4 +-- .../GraphQL/Fields/ContentFieldsProvider.cs | 2 +- ...ntentLocalizationPartHandlerCoordinator.cs | 2 +- .../RecipeSteps/ContentDefinitionStep.cs | 2 +- .../DeleteContentDefinitionStep.cs | 2 +- .../ReplaceContentDefinitionStep.cs | 2 +- .../Recipes/LuceneRecipeEventHandler.cs | 2 +- .../Services/UserProfileClaimsProvider.cs | 2 +- .../Recipes/DeploymentPlansRecipeStep.cs | 6 ++-- .../Recipes/Executors/FeatureStep.cs | 2 +- .../Helpers/ModelStateHelpers.cs | 2 +- .../OrchardCore.Forms/Migrations.cs | 2 +- .../Services/LayerFilter.cs | 2 +- .../Deployment/MediaDeploymentSource.cs | 2 +- .../Processing/ImageSharpUrlFormatter.cs | 4 +-- .../OrchardCore.Media/Recipes/MediaStep.cs | 4 +-- .../CookieOptionsConfiguration.cs | 2 +- .../OpenIdConnectOptionsConfiguration.cs | 2 +- .../CurrentDbProfiler.cs | 2 +- .../MiniProfilerConnectionFactory.cs | 4 +-- .../RecipeSteps/CommandStep.cs | 2 +- .../RecipeSteps/RecipesStep.cs | 4 +-- .../OrchardCore.Redis/Services/RedisLock.cs | 2 +- .../Recipes/LuceneIndexRebuildStep.cs | 2 +- .../Recipes/LuceneIndexResetStep.cs | 2 +- .../Services/LuceneIndexManager.cs | 4 +-- .../Services/TemplateShortcodeProvider.cs | 2 +- .../OrchardCore.Taxonomies/Migrations.cs | 4 +-- .../GraphQL/CurrentUserQuery.cs | 4 +-- .../Http/Filters/WorkflowActionFilter.cs | 2 +- .../Http/Handlers/WorkflowRoutesHandler.cs | 2 +- .../Handlers/WorkflowTypeRoutesHandler.cs | 2 +- .../Services/WorkflowInstanceRouteEntries.cs | 2 +- .../Http/Services/WorkflowTypeRouteEntries.cs | 2 +- .../Extensions/Utility/DependencyOrdering.cs | 2 +- .../Modules/Builder/StartupActions.cs | 2 +- .../Modules/Builder/StartupActionsStartup.cs | 2 +- .../Routing/FormValueRequiredMatcherPolicy.cs | 2 +- .../Shell/Builders/ShellContainerOptions.cs | 2 +- .../Shell/Scope/ShellScope.cs | 2 +- .../Builders/ContentPartDefinitionBuilder.cs | 2 +- .../Builders/ContentTypeDefinitionBuilder.cs | 2 +- .../ContentPartDisplayDriverTPart.cs | 2 +- .../Queries/Predicates/MatchOptions.cs | 6 ++-- .../GenericTypeActivator.cs | 2 +- .../Removing/ShellDbTablesInfo.cs | 2 +- .../LiquidViewTemplate.cs | 2 +- .../OrchardCoreBuilderExtensions.cs | 8 ++--- .../TagHelpers/LiquidTagHelperActivator.cs | 2 +- .../TagHelpers/RequiredAttributeParser.cs | 2 +- .../Arguments.cs | 4 +-- .../ShapeTablePlacementProvider.cs | 2 +- .../Notify/NotifyEntryComparer.cs | 2 +- .../ObjectPool.cs | 4 +-- .../OrchardDisplayHelper.cs | 2 +- .../Shapes/AlternatesCollection.cs | 2 +- .../Title/PageTitleBuilder.cs | 2 +- .../Zones/ZoneShapes.cs | 2 +- .../Commands/DefaultCommandManager.cs | 2 +- .../Shell/ShellDescriptorManager.cs | 2 +- .../LocalizedDataAnnotationsMvcOptions.cs | 2 +- .../PortableObject/PoParser.cs | 2 +- .../CompositeViewLocationExpanderProvider.cs | 2 +- .../RazorPages/PageEndpointComparerPolicy.cs | 2 +- .../YesSql/Migrations/OpenIdMigrations.cs | 8 ++--- .../Mappings/ContainedPartModel.cs | 2 +- .../Mappings/DisplayTextModel.cs | 2 +- .../OrchardCore/Locking/LocalLock.cs | 4 +-- .../Modules/ModularBackgroundService.cs | 2 +- .../Modules/PoweredByMiddleware.cs | 2 +- .../Shell/Builders/StartupBaseMock.cs | 2 +- ...onfiguredFeaturesShellDescriptorManager.cs | 2 +- .../Shell/Distributed/DistributedContext.cs | 2 +- .../DistributedShellHostedService.cs | 2 +- .../Shell/Distributed/ShellIdentifier.cs | 2 +- .../Support/FakeFileProvider.cs | 2 +- .../Examples.Features.AssyAttrib/Root.cs | 2 +- .../Errors.OrchardCoreModules.TwoPlus/Root.cs | 2 +- .../Examples.Modules.AssyAttrib.Alpha/Root.cs | 2 +- .../Examples.Modules.AssyAttrib.Bravo/Root.cs | 2 +- .../Root.cs | 2 +- .../Examples.OrchardCoreModules.Alpha/Root.cs | 2 +- .../Root.cs | 2 +- .../Errors.OrchardCoreThemes.TwoPlus/Root.cs | 2 +- .../Examples.OrchardCoreThemes.Alpha/Root.cs | 2 +- .../Examples.Themes.AssyAttrib.Alpha/Root.cs | 2 +- .../Examples.Themes.AssyAttrib.Bravo/Root.cs | 2 +- .../Root.cs | 2 +- .../Apis/Context/AuthenticationContext.cs | 4 +-- .../Apis/Context/SiteStartup.cs | 2 +- .../Apis/Context/TablePrefixGenerator.cs | 2 +- .../RequiresPermissionValidationRuleTests.cs | 6 ++-- .../DefaultShapeTableManagerTests.cs | 4 +-- .../DefaultDisplayManagerTests.cs | 2 +- .../DisplayManagement/ShapeFactoryTests.cs | 2 +- .../Email/EmailAddressValidatorTests.cs | 2 +- .../Extensions/ExtensionManagerTests.cs | 2 +- .../Workflows/EmailTaskTests.cs | 2 +- .../OpenIdApplicationStepTestsData.cs | 2 +- .../OrchardCore.Tenants/ApiControllerTests.cs | 2 +- .../Recipes/RecipeExecutorTests.cs | 2 +- .../ResourceDefinitionTests.cs | 2 +- .../ResourceManagerTests.cs | 4 +-- .../Routing/AutorouteEntriesTests.cs | 2 +- .../Security/PermissionHandlerHelper.cs | 2 +- .../Shell/ShellContainerFactoryTests.cs | 30 +++++++++---------- 108 files changed, 148 insertions(+), 148 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Admin/AdminPageRouteModelProvider.cs b/src/OrchardCore.Modules/OrchardCore.Admin/AdminPageRouteModelProvider.cs index 3dec3ac2d46..4ac4f126eb7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Admin/AdminPageRouteModelProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.Admin/AdminPageRouteModelProvider.cs @@ -12,7 +12,7 @@ namespace OrchardCore.Admin { - internal class AdminPageRouteModelProvider : IPageRouteModelProvider + internal sealed class AdminPageRouteModelProvider : IPageRouteModelProvider { private readonly IHostEnvironment _hostingEnvironment; private readonly ApplicationPartManager _applicationManager; diff --git a/src/OrchardCore.Modules/OrchardCore.Alias/Services/AliasPartContentHandleProvider.cs b/src/OrchardCore.Modules/OrchardCore.Alias/Services/AliasPartContentHandleProvider.cs index 5bd95527996..8388a62709d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Alias/Services/AliasPartContentHandleProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.Alias/Services/AliasPartContentHandleProvider.cs @@ -31,7 +31,7 @@ public async Task GetContentItemIdAsync(string handle) } } - internal class AliasPartContentHandleHelper + internal sealed class AliasPartContentHandleHelper { #pragma warning disable CA1862 // Use the 'StringComparison' method overloads to perform case-insensitive string comparisons internal static Task QueryAliasIndex(ISession session, string alias) => diff --git a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Services/AlwaysHasChangedToken.cs b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Services/AlwaysHasChangedToken.cs index 04c540f5eff..72a683b5ade 100644 --- a/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Services/AlwaysHasChangedToken.cs +++ b/src/OrchardCore.Modules/OrchardCore.BackgroundTasks/Services/AlwaysHasChangedToken.cs @@ -6,7 +6,7 @@ namespace OrchardCore.BackgroundTasks.Services /// /// An empty change token that is always in the changed state but without raising any change callbacks. /// - internal class AlwaysHasChangedToken : IChangeToken + internal sealed class AlwaysHasChangedToken : IChangeToken { public static AlwaysHasChangedToken Singleton { get; } = new AlwaysHasChangedToken(); @@ -24,7 +24,7 @@ public IDisposable RegisterChangeCallback(Action callback, object state) } } - internal class EmptyDisposable : IDisposable + internal sealed class EmptyDisposable : IDisposable { public static EmptyDisposable Instance { get; } = new EmptyDisposable(); diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/GraphQL/Fields/ContentFieldsProvider.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/GraphQL/Fields/ContentFieldsProvider.cs index 6e3238a6e04..00fcf81cc6d 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/GraphQL/Fields/ContentFieldsProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/GraphQL/Fields/ContentFieldsProvider.cs @@ -116,7 +116,7 @@ public FieldType GetField(ContentPartFieldDefinition field) }; } - private class FieldTypeDescriptor + private sealed class FieldTypeDescriptor { public string Description { get; set; } public Type FieldType { get; set; } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Handlers/ContentLocalizationPartHandlerCoordinator.cs b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Handlers/ContentLocalizationPartHandlerCoordinator.cs index 32687dba983..fc9b0025af7 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Handlers/ContentLocalizationPartHandlerCoordinator.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Handlers/ContentLocalizationPartHandlerCoordinator.cs @@ -7,7 +7,7 @@ namespace OrchardCore.ContentLocalization.Handlers { - internal class ContentLocalizationPartHandlerCoordinator : ContentLocalizationHandlerBase + internal sealed class ContentLocalizationPartHandlerCoordinator : ContentLocalizationHandlerBase { private readonly ITypeActivatorFactory _contentPartFactory; private readonly IEnumerable _partHandlers; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ContentDefinitionStep.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ContentDefinitionStep.cs index 73caa66a5c5..1eb43b95749 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ContentDefinitionStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ContentDefinitionStep.cs @@ -77,7 +77,7 @@ private Task UpdateContentPartAsync(ContentPartDefinition part, ContentPartDefin } }); - private class ContentDefinitionStepModel + private sealed class ContentDefinitionStepModel { public ContentTypeDefinitionRecord[] ContentTypes { get; set; } = []; public ContentPartDefinitionRecord[] ContentParts { get; set; } = []; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/DeleteContentDefinitionStep.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/DeleteContentDefinitionStep.cs index 2e243eb2e81..cf37538caab 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/DeleteContentDefinitionStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/DeleteContentDefinitionStep.cs @@ -41,7 +41,7 @@ public async Task ExecuteAsync(RecipeExecutionContext context) } } - private class DeleteContentDefinitionStepModel + private sealed class DeleteContentDefinitionStepModel { public string[] ContentTypes { get; set; } = []; public string[] ContentParts { get; set; } = []; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ReplaceContentDefinitionStep.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ReplaceContentDefinitionStep.cs index 6822f856922..93704b92a6f 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ReplaceContentDefinitionStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/RecipeSteps/ReplaceContentDefinitionStep.cs @@ -81,7 +81,7 @@ await _contentDefinitionManager.AlterPartDefinitionAsync(record.Name, builder => }); } - private class ReplaceContentDefinitionStepModel + private sealed class ReplaceContentDefinitionStepModel { public ContentTypeDefinitionRecord[] ContentTypes { get; set; } = []; public ContentPartDefinitionRecord[] ContentParts { get; set; } = []; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Recipes/LuceneRecipeEventHandler.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Recipes/LuceneRecipeEventHandler.cs index 64a7d041392..3b19ecc1668 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Recipes/LuceneRecipeEventHandler.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Recipes/LuceneRecipeEventHandler.cs @@ -78,7 +78,7 @@ public Task RecipeStepExecutingAsync(RecipeExecutionContext context) return Task.CompletedTask; } - private class ContentDefinitionStepModel + private sealed class ContentDefinitionStepModel { public string Name { get; set; } public ContentTypeDefinitionRecord[] ContentTypes { get; set; } = []; diff --git a/src/OrchardCore.Modules/OrchardCore.Demo/Services/UserProfileClaimsProvider.cs b/src/OrchardCore.Modules/OrchardCore.Demo/Services/UserProfileClaimsProvider.cs index a73efd5055e..738bf9a3dc3 100644 --- a/src/OrchardCore.Modules/OrchardCore.Demo/Services/UserProfileClaimsProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.Demo/Services/UserProfileClaimsProvider.cs @@ -11,7 +11,7 @@ namespace OrchardCore.Demo.Services { - internal class UserProfileClaimsProvider : IUserClaimsProvider + internal sealed class UserProfileClaimsProvider : IUserClaimsProvider { public Task GenerateAsync(IUser user, ClaimsIdentity claims) { diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/Recipes/DeploymentPlansRecipeStep.cs b/src/OrchardCore.Modules/OrchardCore.Deployment/Recipes/DeploymentPlansRecipeStep.cs index a42a21551ce..678d091fe4a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/Recipes/DeploymentPlansRecipeStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/Recipes/DeploymentPlansRecipeStep.cs @@ -80,19 +80,19 @@ public Task ExecuteAsync(RecipeExecutionContext context) return _deploymentPlanService.CreateOrUpdateDeploymentPlansAsync(deploymentPlans); } - private class DeploymentPlansModel + private sealed class DeploymentPlansModel { public DeploymentPlanModel[] Plans { get; set; } } - private class DeploymentPlanModel + private sealed class DeploymentPlanModel { public string Name { get; set; } public DeploymentStepModel[] Steps { get; set; } } - private class DeploymentStepModel + private sealed class DeploymentStepModel { public string Type { get; set; } diff --git a/src/OrchardCore.Modules/OrchardCore.Features/Recipes/Executors/FeatureStep.cs b/src/OrchardCore.Modules/OrchardCore.Features/Recipes/Executors/FeatureStep.cs index 411c423f494..ba7c463b7cf 100644 --- a/src/OrchardCore.Modules/OrchardCore.Features/Recipes/Executors/FeatureStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.Features/Recipes/Executors/FeatureStep.cs @@ -41,7 +41,7 @@ public async Task ExecuteAsync(RecipeExecutionContext context) } } - private class FeatureStepModel + private sealed class FeatureStepModel { public string Name { get; set; } public string[] Disable { get; set; } diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Helpers/ModelStateHelpers.cs b/src/OrchardCore.Modules/OrchardCore.Forms/Helpers/ModelStateHelpers.cs index 20e3d5ed733..37e22297109 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/Helpers/ModelStateHelpers.cs +++ b/src/OrchardCore.Modules/OrchardCore.Forms/Helpers/ModelStateHelpers.cs @@ -38,7 +38,7 @@ public static ModelStateDictionary DeserializeModelState(string serialisedErrorL return modelState; } - private class ModelStateTransferValue + private sealed class ModelStateTransferValue { public string Key { get; set; } public string AttemptedValue { get; set; } diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Migrations.cs b/src/OrchardCore.Modules/OrchardCore.Forms/Migrations.cs index c1629600ef9..ee05771fb5e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/Migrations.cs +++ b/src/OrchardCore.Modules/OrchardCore.Forms/Migrations.cs @@ -259,7 +259,7 @@ await _contentDefinitionManager.AlterTypeDefinitionAsync("TextArea", type => typ return 4; } - internal class TitlePartSettings + internal sealed class TitlePartSettings { public int Options { get; set; } diff --git a/src/OrchardCore.Modules/OrchardCore.Layers/Services/LayerFilter.cs b/src/OrchardCore.Modules/OrchardCore.Layers/Services/LayerFilter.cs index a8f56f461b1..47e4cb233f7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Layers/Services/LayerFilter.cs +++ b/src/OrchardCore.Modules/OrchardCore.Layers/Services/LayerFilter.cs @@ -143,7 +143,7 @@ public async Task OnResultExecutionAsync(ResultExecutingContext context, ResultE await next.Invoke(); } - internal class CacheEntry : Document + internal sealed class CacheEntry : Document { public IEnumerable Widgets { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Media/Deployment/MediaDeploymentSource.cs b/src/OrchardCore.Modules/OrchardCore.Media/Deployment/MediaDeploymentSource.cs index 0daf8bbb92a..ac818c320dc 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/Deployment/MediaDeploymentSource.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media/Deployment/MediaDeploymentSource.cs @@ -57,7 +57,7 @@ public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlan }); } - private class MediaDeploymentStepModel + private sealed class MediaDeploymentStepModel { public string SourcePath { get; set; } public string TargetPath { get; set; } diff --git a/src/OrchardCore.Modules/OrchardCore.Media/Processing/ImageSharpUrlFormatter.cs b/src/OrchardCore.Modules/OrchardCore.Media/Processing/ImageSharpUrlFormatter.cs index 6edffe6614a..bd5e5ec26db 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/Processing/ImageSharpUrlFormatter.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media/Processing/ImageSharpUrlFormatter.cs @@ -27,7 +27,7 @@ public enum Format WebP } - internal class ImageSharpUrlFormatter + internal sealed class ImageSharpUrlFormatter { public static string GetImageResizeUrl(string path, IDictionary queryStringParams = null, int? width = null, int? height = null, ResizeMode resizeMode = ResizeMode.Undefined, int? quality = null, Format format = Format.Undefined, Anchor anchor = null, string bgcolor = null) { @@ -53,7 +53,7 @@ public static string GetImageResizeUrl(string path, IDictionary queryStringParams["rmode"] = resizeMode.ToString().ToLower(); } - // The format is set before quality such that the quality is not + // The format is set before quality such that the quality is not // invalidated when the url is generated. if (format != Format.Undefined) { diff --git a/src/OrchardCore.Modules/OrchardCore.Media/Recipes/MediaStep.cs b/src/OrchardCore.Modules/OrchardCore.Media/Recipes/MediaStep.cs index e6d5b5407f5..dc276494929 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/Recipes/MediaStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media/Recipes/MediaStep.cs @@ -91,7 +91,7 @@ public async Task ExecuteAsync(RecipeExecutionContext context) } } - private class MediaStepModel + private sealed class MediaStepModel { /// /// Collection of objects. @@ -99,7 +99,7 @@ private class MediaStepModel public MediaStepFile[] Files { get; set; } } - private class MediaStepFile + private sealed class MediaStepFile { /// /// Path where the content will be written. diff --git a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Configuration/CookieOptionsConfiguration.cs b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Configuration/CookieOptionsConfiguration.cs index 8a79e7d7a11..c525a189e97 100644 --- a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Configuration/CookieOptionsConfiguration.cs +++ b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Configuration/CookieOptionsConfiguration.cs @@ -6,7 +6,7 @@ namespace OrchardCore.Microsoft.Authentication.Configuration { - internal class CookieOptionsConfiguration : IConfigureNamedOptions + internal sealed class CookieOptionsConfiguration : IConfigureNamedOptions { private readonly string _tenantPrefix; diff --git a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Configuration/OpenIdConnectOptionsConfiguration.cs b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Configuration/OpenIdConnectOptionsConfiguration.cs index 0d523f8fac9..0af3d0995aa 100644 --- a/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Configuration/OpenIdConnectOptionsConfiguration.cs +++ b/src/OrchardCore.Modules/OrchardCore.Microsoft.Authentication/Configuration/OpenIdConnectOptionsConfiguration.cs @@ -8,7 +8,7 @@ namespace OrchardCore.Microsoft.Authentication.Configuration { - internal class OpenIdConnectOptionsConfiguration : IConfigureNamedOptions + internal sealed class OpenIdConnectOptionsConfiguration : IConfigureNamedOptions { private readonly IOptionsMonitor _azureADOptions; private readonly AzureADSettings _azureADSettings; diff --git a/src/OrchardCore.Modules/OrchardCore.MiniProfiler/CurrentDbProfiler.cs b/src/OrchardCore.Modules/OrchardCore.MiniProfiler/CurrentDbProfiler.cs index 10242b2c8e1..82b13059870 100644 --- a/src/OrchardCore.Modules/OrchardCore.MiniProfiler/CurrentDbProfiler.cs +++ b/src/OrchardCore.Modules/OrchardCore.MiniProfiler/CurrentDbProfiler.cs @@ -5,7 +5,7 @@ namespace OrchardCore.MiniProfiler { - internal class CurrentDbProfiler : IDbProfiler + internal sealed class CurrentDbProfiler : IDbProfiler { private Func GetProfiler { get; } public CurrentDbProfiler(Func getProfiler) => GetProfiler = getProfiler; diff --git a/src/OrchardCore.Modules/OrchardCore.MiniProfiler/MiniProfilerConnectionFactory.cs b/src/OrchardCore.Modules/OrchardCore.MiniProfiler/MiniProfilerConnectionFactory.cs index 0b579900aa0..555af9f3146 100644 --- a/src/OrchardCore.Modules/OrchardCore.MiniProfiler/MiniProfilerConnectionFactory.cs +++ b/src/OrchardCore.Modules/OrchardCore.MiniProfiler/MiniProfilerConnectionFactory.cs @@ -5,9 +5,9 @@ namespace OrchardCore.MiniProfiler { - internal class MiniProfilerConnectionFactory : IConnectionFactory + internal sealed class MiniProfilerConnectionFactory : IConnectionFactory { - protected static readonly string ConnectionName = nameof(ProfiledDbConnection).ToLower(); + private static readonly string ConnectionName = nameof(ProfiledDbConnection).ToLower(); private readonly IConnectionFactory _factory; diff --git a/src/OrchardCore.Modules/OrchardCore.Recipes/RecipeSteps/CommandStep.cs b/src/OrchardCore.Modules/OrchardCore.Recipes/RecipeSteps/CommandStep.cs index 0a98156f2bc..356133e8387 100644 --- a/src/OrchardCore.Modules/OrchardCore.Recipes/RecipeSteps/CommandStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.Recipes/RecipeSteps/CommandStep.cs @@ -54,7 +54,7 @@ public async Task ExecuteAsync(RecipeExecutionContext context) } } - private class CommandStepModel + private sealed class CommandStepModel { public string[] Commands { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Recipes/RecipeSteps/RecipesStep.cs b/src/OrchardCore.Modules/OrchardCore.Recipes/RecipeSteps/RecipesStep.cs index 49c4199d6c2..831de91ad9a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Recipes/RecipeSteps/RecipesStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.Recipes/RecipeSteps/RecipesStep.cs @@ -46,12 +46,12 @@ public async Task ExecuteAsync(RecipeExecutionContext context) context.InnerRecipes = innerRecipes; } - private class InternalStep + private sealed class InternalStep { public InternalStepValue[] Values { get; set; } } - private class InternalStepValue + private sealed class InternalStepValue { public string ExecutionId { get; set; } public string Name { get; set; } diff --git a/src/OrchardCore.Modules/OrchardCore.Redis/Services/RedisLock.cs b/src/OrchardCore.Modules/OrchardCore.Redis/Services/RedisLock.cs index 41849aa82ba..dc24da9ce9d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Redis/Services/RedisLock.cs +++ b/src/OrchardCore.Modules/OrchardCore.Redis/Services/RedisLock.cs @@ -146,7 +146,7 @@ private void Release(string key) } } - private class Locker : ILocker + private sealed class Locker : ILocker { private readonly RedisLock _lock; private readonly string _key; diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Recipes/LuceneIndexRebuildStep.cs b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Recipes/LuceneIndexRebuildStep.cs index c3dfae69f51..50a31354fd7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Recipes/LuceneIndexRebuildStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Recipes/LuceneIndexRebuildStep.cs @@ -47,7 +47,7 @@ await HttpBackgroundJob.ExecuteAfterEndOfRequestAsync("lucene-index-rebuild", as } } - private class LuceneIndexRebuildStepModel + private sealed class LuceneIndexRebuildStepModel { public bool IncludeAll { get; set; } = false; public string[] Indices { get; set; } = []; diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Recipes/LuceneIndexResetStep.cs b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Recipes/LuceneIndexResetStep.cs index 62b17fd72d3..7ad59906e4c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Recipes/LuceneIndexResetStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Recipes/LuceneIndexResetStep.cs @@ -53,7 +53,7 @@ await HttpBackgroundJob.ExecuteAfterEndOfRequestAsync("lucene-index-reset", asyn } } - private class LuceneIndexResetStepModel + private sealed class LuceneIndexResetStepModel { public bool IncludeAll { get; set; } = false; public string[] Indices { get; set; } = []; diff --git a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Services/LuceneIndexManager.cs b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Services/LuceneIndexManager.cs index af41d25e452..50d1c3434db 100644 --- a/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Services/LuceneIndexManager.cs +++ b/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Services/LuceneIndexManager.cs @@ -520,7 +520,7 @@ public void Dispose() } } - internal class IndexWriterWrapper : IndexWriter + internal sealed class IndexWriterWrapper : IndexWriter { public IndexWriterWrapper(LDirectory directory, IndexWriterConfig config) : base(directory, config) { @@ -530,7 +530,7 @@ public IndexWriterWrapper(LDirectory directory, IndexWriterConfig config) : base public bool IsClosing { get; set; } } - internal class IndexReaderPool : IDisposable + internal sealed class IndexReaderPool : IDisposable { private bool _dirty; private int _count; diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/Services/TemplateShortcodeProvider.cs b/src/OrchardCore.Modules/OrchardCore.Shortcodes/Services/TemplateShortcodeProvider.cs index b9a0d869299..61462f10414 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/Services/TemplateShortcodeProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/Services/TemplateShortcodeProvider.cs @@ -65,7 +65,7 @@ public async ValueTask EvaluateAsync(string identifier, Arguments argume return result; } - internal class Content : LiquidContentAccessor + internal sealed class Content : LiquidContentAccessor { public readonly string _content; public Content(string content) => _content = content; diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Migrations.cs b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Migrations.cs index 15aa789f3b2..16f3858f608 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Migrations.cs +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Migrations.cs @@ -169,12 +169,12 @@ await SchemaBuilder.AlterIndexTableAsync(table => table } } - internal class AliasPartSettings + internal sealed class AliasPartSettings { public string Pattern { get; set; } } - internal class AutoroutePartSettings + internal sealed class AutoroutePartSettings { public string Pattern { get; set; } public bool AllowRouteContainedItems { get; set; } diff --git a/src/OrchardCore.Modules/OrchardCore.Users/GraphQL/CurrentUserQuery.cs b/src/OrchardCore.Modules/OrchardCore.Users/GraphQL/CurrentUserQuery.cs index 2852fed8f0e..f07f713ebbf 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/GraphQL/CurrentUserQuery.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/GraphQL/CurrentUserQuery.cs @@ -18,11 +18,11 @@ namespace OrchardCore.Users.GraphQL; /// /// Registers the current user including its custom user settings as a query. /// -internal class CurrentUserQuery : ISchemaBuilder +internal sealed class CurrentUserQuery : ISchemaBuilder { private readonly IHttpContextAccessor _httpContextAccessor; private readonly IOptions _contentOptionsAccessor; - protected readonly IStringLocalizer S; + private readonly IStringLocalizer S; public CurrentUserQuery( IHttpContextAccessor httpContextAccessor, diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Filters/WorkflowActionFilter.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Filters/WorkflowActionFilter.cs index b6b5bbf71bb..b9fc462a77c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Filters/WorkflowActionFilter.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Filters/WorkflowActionFilter.cs @@ -8,7 +8,7 @@ namespace OrchardCore.Workflows.Http.Filters { - internal class WorkflowActionFilter : IAsyncActionFilter + internal sealed class WorkflowActionFilter : IAsyncActionFilter { private readonly IWorkflowManager _workflowManager; private readonly IWorkflowTypeRouteEntries _workflowTypeRouteEntries; diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Handlers/WorkflowRoutesHandler.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Handlers/WorkflowRoutesHandler.cs index c3bbce71893..eeb6e1f09af 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Handlers/WorkflowRoutesHandler.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Handlers/WorkflowRoutesHandler.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Workflows.Http.Handlers { - internal class WorkflowRoutesHandler : WorkflowHandlerBase + internal sealed class WorkflowRoutesHandler : WorkflowHandlerBase { private readonly IWorkflowInstanceRouteEntries _workflowRouteEntries; private readonly IWorkflowTypeStore _workflowTypeStore; diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Handlers/WorkflowTypeRoutesHandler.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Handlers/WorkflowTypeRoutesHandler.cs index f1d865d1c72..c7f61e91cb1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Handlers/WorkflowTypeRoutesHandler.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Handlers/WorkflowTypeRoutesHandler.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Workflows.Http.Handlers { - internal class WorkflowTypeRoutesHandler : WorkflowTypeHandlerBase + internal sealed class WorkflowTypeRoutesHandler : WorkflowTypeHandlerBase { private readonly IWorkflowTypeRouteEntries _workflowRouteEntries; private readonly IActivityLibrary _activityLibrary; diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Services/WorkflowInstanceRouteEntries.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Services/WorkflowInstanceRouteEntries.cs index 448a9973786..a2d37e651f2 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Services/WorkflowInstanceRouteEntries.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Services/WorkflowInstanceRouteEntries.cs @@ -11,7 +11,7 @@ namespace OrchardCore.Workflows.Http.Services { - internal class WorkflowInstanceRouteEntries : WorkflowRouteEntries, IWorkflowInstanceRouteEntries + internal sealed class WorkflowInstanceRouteEntries : WorkflowRouteEntries, IWorkflowInstanceRouteEntries { public WorkflowInstanceRouteEntries(IVolatileDocumentManager documentManager) : base(documentManager) { } diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Services/WorkflowTypeRouteEntries.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Services/WorkflowTypeRouteEntries.cs index 411be37c280..5fb35a557d4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Services/WorkflowTypeRouteEntries.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Services/WorkflowTypeRouteEntries.cs @@ -11,7 +11,7 @@ namespace OrchardCore.Workflows.Http.Services { - internal class WorkflowTypeRouteEntries : WorkflowRouteEntries, IWorkflowTypeRouteEntries + internal sealed class WorkflowTypeRouteEntries : WorkflowRouteEntries, IWorkflowTypeRouteEntries { public WorkflowTypeRouteEntries(IVolatileDocumentManager documentManager) : base(documentManager) { } diff --git a/src/OrchardCore/OrchardCore.Abstractions/Extensions/Utility/DependencyOrdering.cs b/src/OrchardCore/OrchardCore.Abstractions/Extensions/Utility/DependencyOrdering.cs index 2b6f19d5466..056b085b691 100644 --- a/src/OrchardCore/OrchardCore.Abstractions/Extensions/Utility/DependencyOrdering.cs +++ b/src/OrchardCore/OrchardCore.Abstractions/Extensions/Utility/DependencyOrdering.cs @@ -6,7 +6,7 @@ namespace OrchardCore.Environment.Extensions.Utility { public static class DependencyOrdering { - private class Node + private sealed class Node { public T Item { get; set; } public bool Used { get; set; } diff --git a/src/OrchardCore/OrchardCore.Abstractions/Modules/Builder/StartupActions.cs b/src/OrchardCore/OrchardCore.Abstractions/Modules/Builder/StartupActions.cs index a3db50bd063..580d2fe3097 100644 --- a/src/OrchardCore/OrchardCore.Abstractions/Modules/Builder/StartupActions.cs +++ b/src/OrchardCore/OrchardCore.Abstractions/Modules/Builder/StartupActions.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.DependencyInjection { - internal class StartupActions + internal sealed class StartupActions { public StartupActions(int order) { diff --git a/src/OrchardCore/OrchardCore.Abstractions/Modules/Builder/StartupActionsStartup.cs b/src/OrchardCore/OrchardCore.Abstractions/Modules/Builder/StartupActionsStartup.cs index 20273aaf0d9..9c571616a58 100644 --- a/src/OrchardCore/OrchardCore.Abstractions/Modules/Builder/StartupActionsStartup.cs +++ b/src/OrchardCore/OrchardCore.Abstractions/Modules/Builder/StartupActionsStartup.cs @@ -9,7 +9,7 @@ namespace OrchardCore.Modules /// /// Represents a fake Startup class that is composed of Configure and ConfigureServices lambdas. /// - internal class StartupActionsStartup : StartupBase + internal sealed class StartupActionsStartup : StartupBase { private readonly IServiceProvider _serviceProvider; private readonly StartupActions _actions; diff --git a/src/OrchardCore/OrchardCore.Abstractions/Routing/FormValueRequiredMatcherPolicy.cs b/src/OrchardCore/OrchardCore.Abstractions/Routing/FormValueRequiredMatcherPolicy.cs index 6d082488154..ffd06c52705 100644 --- a/src/OrchardCore/OrchardCore.Abstractions/Routing/FormValueRequiredMatcherPolicy.cs +++ b/src/OrchardCore/OrchardCore.Abstractions/Routing/FormValueRequiredMatcherPolicy.cs @@ -67,7 +67,7 @@ public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) public IComparer Comparer => new FormValueRequiredEndpointComparer(); - private class FormValueRequiredEndpointComparer : EndpointMetadataComparer + private sealed class FormValueRequiredEndpointComparer : EndpointMetadataComparer { protected override int CompareMetadata(FormValueRequiredAttribute x, FormValueRequiredAttribute y) { diff --git a/src/OrchardCore/OrchardCore.Abstractions/Shell/Builders/ShellContainerOptions.cs b/src/OrchardCore/OrchardCore.Abstractions/Shell/Builders/ShellContainerOptions.cs index ea05df8d35d..b8833b23f8e 100644 --- a/src/OrchardCore/OrchardCore.Abstractions/Shell/Builders/ShellContainerOptions.cs +++ b/src/OrchardCore/OrchardCore.Abstractions/Shell/Builders/ShellContainerOptions.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Environment.Shell.Builders; -internal class ShellContainerOptions +internal sealed class ShellContainerOptions { /// /// Delegates to be invoked asynchronously after a tenant container is created. diff --git a/src/OrchardCore/OrchardCore.Abstractions/Shell/Scope/ShellScope.cs b/src/OrchardCore/OrchardCore.Abstractions/Shell/Scope/ShellScope.cs index a838e28f958..df79c757eea 100644 --- a/src/OrchardCore/OrchardCore.Abstractions/Shell/Scope/ShellScope.cs +++ b/src/OrchardCore/OrchardCore.Abstractions/Shell/Scope/ShellScope.cs @@ -565,7 +565,7 @@ private void Terminate() } } - private class ShellScopeHolder + private sealed class ShellScopeHolder { public ShellScope Scope; } diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentPartDefinitionBuilder.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentPartDefinitionBuilder.cs index aad503c3da1..2153ce1acbf 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentPartDefinitionBuilder.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentPartDefinitionBuilder.cs @@ -212,7 +212,7 @@ public async Task WithFieldAsync(string fieldName, return this; } - private class FieldConfigurerImpl : ContentPartFieldDefinitionBuilder + private sealed class FieldConfigurerImpl : ContentPartFieldDefinitionBuilder { private ContentFieldDefinition _fieldDefinition; private readonly ContentPartDefinition _partDefinition; diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypeDefinitionBuilder.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypeDefinitionBuilder.cs index ff0b7d413de..36a0d3d45dc 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypeDefinitionBuilder.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypeDefinitionBuilder.cs @@ -195,7 +195,7 @@ public async Task WithPartAsync(string name, Conte return this; } - private class PartConfigurerImpl : ContentTypePartDefinitionBuilder + private sealed class PartConfigurerImpl : ContentTypePartDefinitionBuilder { private readonly ContentPartDefinition _partDefinition; diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Display/ContentDisplay/ContentPartDisplayDriverTPart.cs b/src/OrchardCore/OrchardCore.ContentManagement.Display/ContentDisplay/ContentPartDisplayDriverTPart.cs index ec1bd4ea464..5944ecbb94d 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Display/ContentDisplay/ContentPartDisplayDriverTPart.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Display/ContentDisplay/ContentPartDisplayDriverTPart.cs @@ -345,7 +345,7 @@ private TempPrefix BuildPrefix(ContentTypePartDefinition typePartDefinition, str /// /// Restores the previous prefix automatically. /// - private class TempPrefix : IDisposable + private sealed class TempPrefix : IDisposable { private readonly ContentPartDisplayDriver _driver; private readonly string _originalPrefix; diff --git a/src/OrchardCore/OrchardCore.ContentManagement.GraphQL/Queries/Predicates/MatchOptions.cs b/src/OrchardCore/OrchardCore.ContentManagement.GraphQL/Queries/Predicates/MatchOptions.cs index d6eae559da5..8be687787c0 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.GraphQL/Queries/Predicates/MatchOptions.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.GraphQL/Queries/Predicates/MatchOptions.cs @@ -33,7 +33,7 @@ public abstract class MatchOptions /// /// The that matches if the string starts with the pattern. /// - private class StartsWithMatchOptions : MatchOptions + private sealed class StartsWithMatchOptions : MatchOptions { /// public override string ToMatchString(string pattern) @@ -45,7 +45,7 @@ public override string ToMatchString(string pattern) /// /// The that matches if the string ends with the pattern. /// - private class EndsWithMatchOptions : MatchOptions + private sealed class EndsWithMatchOptions : MatchOptions { /// public override string ToMatchString(string pattern) @@ -57,7 +57,7 @@ public override string ToMatchString(string pattern) /// /// The that matches if the string contains the pattern. /// - private class ContainsMatchOptions : MatchOptions + private sealed class ContainsMatchOptions : MatchOptions { /// public override string ToMatchString(string pattern) diff --git a/src/OrchardCore/OrchardCore.ContentManagement/GenericTypeActivator.cs b/src/OrchardCore/OrchardCore.ContentManagement/GenericTypeActivator.cs index 8e076e701c2..c66b9051c76 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement/GenericTypeActivator.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement/GenericTypeActivator.cs @@ -2,7 +2,7 @@ namespace OrchardCore.ContentManagement { - internal class GenericTypeActivator : ITypeActivator where T : TInstance, new() + internal sealed class GenericTypeActivator : ITypeActivator where T : TInstance, new() { /// public Type Type => typeof(T); diff --git a/src/OrchardCore/OrchardCore.Data.YesSql/Removing/ShellDbTablesInfo.cs b/src/OrchardCore/OrchardCore.Data.YesSql/Removing/ShellDbTablesInfo.cs index 4ec7ecc8ee5..45df6706a05 100644 --- a/src/OrchardCore/OrchardCore.Data.YesSql/Removing/ShellDbTablesInfo.cs +++ b/src/OrchardCore/OrchardCore.Data.YesSql/Removing/ShellDbTablesInfo.cs @@ -13,7 +13,7 @@ namespace OrchardCore.Environment.Shell.Removing; -internal class ShellDbTablesInfo : ISchemaBuilder +internal sealed class ShellDbTablesInfo : ISchemaBuilder { private ICommandInterpreter _commandInterpreter; public string TablePrefix { get; set; } diff --git a/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/LiquidViewTemplate.cs b/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/LiquidViewTemplate.cs index 41e808030c5..6f5c879180f 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/LiquidViewTemplate.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/LiquidViewTemplate.cs @@ -99,7 +99,7 @@ public static Task ParseAsync(LiquidViewParser parser, strin } } - internal class ShapeAccessor : DelegateAccessor + internal sealed class ShapeAccessor : DelegateAccessor { public ShapeAccessor() : base((obj, name, ctx) => _getter(obj, name)) { diff --git a/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/OrchardCoreBuilderExtensions.cs b/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/OrchardCoreBuilderExtensions.cs index d03b6f95bbb..c739f118d0c 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/OrchardCoreBuilderExtensions.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/OrchardCoreBuilderExtensions.cs @@ -178,7 +178,7 @@ public static OrchardCoreBuilder AddLiquidViews(this OrchardCoreBuilder builder) return builder; } - private class CookieCollectionWrapper + private sealed class CookieCollectionWrapper { public readonly IRequestCookieCollection RequestCookieCollection; @@ -188,7 +188,7 @@ public CookieCollectionWrapper(IRequestCookieCollection requestCookieCollection) } } - private class HeaderDictionaryWrapper + private sealed class HeaderDictionaryWrapper { public readonly IHeaderDictionary HeaderDictionary; @@ -198,7 +198,7 @@ public HeaderDictionaryWrapper(IHeaderDictionary headerDictionary) } } - private class HttpContextItemsWrapper + private sealed class HttpContextItemsWrapper { public readonly IDictionary Items; @@ -208,7 +208,7 @@ public HttpContextItemsWrapper(IDictionary items) } } - private class RouteValueDictionaryWrapper + private sealed class RouteValueDictionaryWrapper { public readonly IReadOnlyDictionary RouteValueDictionary; diff --git a/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/TagHelpers/LiquidTagHelperActivator.cs b/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/TagHelpers/LiquidTagHelperActivator.cs index 3b8a4f9b287..8f61d82e1ca 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/TagHelpers/LiquidTagHelperActivator.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/TagHelpers/LiquidTagHelperActivator.cs @@ -214,7 +214,7 @@ public ITagHelper Create(ITagHelperFactory factory, ViewContext context, FilterA return tagHelper; } - private class ReusableTagHelperFactory where T : class, ITagHelper + private sealed class ReusableTagHelperFactory where T : class, ITagHelper { public static ITagHelper CreateTagHelper(ITagHelperFactory tagHelperFactory, ViewContext viewContext) { diff --git a/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/TagHelpers/RequiredAttributeParser.cs b/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/TagHelpers/RequiredAttributeParser.cs index e0584e1ca29..a4051068560 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/TagHelpers/RequiredAttributeParser.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement.Liquid/TagHelpers/RequiredAttributeParser.cs @@ -14,7 +14,7 @@ public static void AddRequiredAttributes(string requiredAttributes, TagMatchingR requiredAttributeParser.AddRequiredAttributes(ruleBuilder); } - private class DefaultRequiredAttributeParser + private sealed class DefaultRequiredAttributeParser { private const char RequiredAttributeWildcardSuffix = '*'; diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/Arguments.cs b/src/OrchardCore/OrchardCore.DisplayManagement/Arguments.cs index e7e8bcc5663..3f8527424f8 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/Arguments.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/Arguments.cs @@ -49,7 +49,7 @@ public static INamedEnumerable From(object propertyObject) return propertiesAccessor(propertyObject); } - private class NamedEnumerable : INamedEnumerable + private sealed class NamedEnumerable : INamedEnumerable { private readonly List _arguments; private readonly List _names; @@ -91,7 +91,7 @@ IDictionary INamedEnumerable.Named get { return _named ??= new Named(_arguments, _names); } } - private class Named : IDictionary + private sealed class Named : IDictionary { private readonly IList _arguments; private readonly IList _names; diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/Descriptors/ShapeTablePlacementProvider.cs b/src/OrchardCore/OrchardCore.DisplayManagement/Descriptors/ShapeTablePlacementProvider.cs index e11a2ee0ed0..eac87145e36 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/Descriptors/ShapeTablePlacementProvider.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/Descriptors/ShapeTablePlacementProvider.cs @@ -33,7 +33,7 @@ public async Task BuildPlacementInfoResolverAsync(IBuild return new ShapeTablePlacementResolver(shapeTable); } - private class ShapeTablePlacementResolver : IPlacementInfoResolver + private sealed class ShapeTablePlacementResolver : IPlacementInfoResolver { private readonly ShapeTable _shapeTable; diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/Notify/NotifyEntryComparer.cs b/src/OrchardCore/OrchardCore.DisplayManagement/Notify/NotifyEntryComparer.cs index eae765b08b7..9a718082bc0 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/Notify/NotifyEntryComparer.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/Notify/NotifyEntryComparer.cs @@ -4,7 +4,7 @@ namespace OrchardCore.DisplayManagement.Notify { - internal class NotifyEntryComparer : IEqualityComparer + internal sealed class NotifyEntryComparer : IEqualityComparer { private readonly HtmlEncoder _htmlEncoder; diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/ObjectPool.cs b/src/OrchardCore/OrchardCore.DisplayManagement/ObjectPool.cs index 0b3660c8a4a..6ea90b89dad 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/ObjectPool.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/ObjectPool.cs @@ -24,7 +24,7 @@ namespace OrchardCore.DisplayManagement /// Rationale: /// If there is no intent for reusing the object, do not use pool - just use "new". /// - internal class ObjectPool where T : class + internal sealed class ObjectPool where T : class { [DebuggerDisplay("{Value,nq}")] private struct Element @@ -52,7 +52,7 @@ private struct Element #if DETECT_LEAKS private static readonly ConditionalWeakTable leakTrackers = new ConditionalWeakTable(); - private class LeakTracker : IDisposable + private sealed class LeakTracker : IDisposable { private volatile bool disposed; diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/OrchardDisplayHelper.cs b/src/OrchardCore/OrchardCore.DisplayManagement/OrchardDisplayHelper.cs index afafcd5f35d..6ec25810794 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/OrchardDisplayHelper.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/OrchardDisplayHelper.cs @@ -2,7 +2,7 @@ namespace OrchardCore.DisplayManagement.Razor { - internal class OrchardDisplayHelper : IOrchardDisplayHelper + internal sealed class OrchardDisplayHelper : IOrchardDisplayHelper { public OrchardDisplayHelper(HttpContext context, IDisplayHelper displayHelper) { diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/Shapes/AlternatesCollection.cs b/src/OrchardCore/OrchardCore.DisplayManagement/Shapes/AlternatesCollection.cs index 907aa2b8906..caca76f2028 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/Shapes/AlternatesCollection.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/Shapes/AlternatesCollection.cs @@ -122,7 +122,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetEnumerator(); } - private class KeyedAlternateCollection : KeyedCollection + private sealed class KeyedAlternateCollection : KeyedCollection { protected override string GetKeyForItem(string item) { diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/Title/PageTitleBuilder.cs b/src/OrchardCore/OrchardCore.DisplayManagement/Title/PageTitleBuilder.cs index 165bf0801ec..4909ed2940f 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/Title/PageTitleBuilder.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/Title/PageTitleBuilder.cs @@ -88,7 +88,7 @@ public void Clear() } } - internal class PositionalTitlePart : IPositioned + internal sealed class PositionalTitlePart : IPositioned { public string Position { get; set; } public IHtmlContent Value { get; set; } diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/Zones/ZoneShapes.cs b/src/OrchardCore/OrchardCore.DisplayManagement/Zones/ZoneShapes.cs index 2c268a978fc..c56a80ed73f 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/Zones/ZoneShapes.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/Zones/ZoneShapes.cs @@ -438,7 +438,7 @@ private static object FirstGroupingWithModifierOrDefault(IGrouping MatchCommands(CommandParameters parameters, in } } - private class Match + private sealed class Match { public CommandContext Context { get; set; } public ICommandHandler CommandHandler { get; set; } diff --git a/src/OrchardCore/OrchardCore.Infrastructure/Shell/ShellDescriptorManager.cs b/src/OrchardCore/OrchardCore.Infrastructure/Shell/ShellDescriptorManager.cs index fee78484560..9c7b6ba54c9 100644 --- a/src/OrchardCore/OrchardCore.Infrastructure/Shell/ShellDescriptorManager.cs +++ b/src/OrchardCore/OrchardCore.Infrastructure/Shell/ShellDescriptorManager.cs @@ -140,7 +140,7 @@ await _shellDescriptorManagerEventHandlers.InvokeAsync((handler, shellDescriptor handler.ChangedAsync(shellDescriptor, _shellSettings), shellDescriptor, _shellSettings, _logger); } - private class ConfiguredFeatures + private sealed class ConfiguredFeatures { public string[] Features { get; set; } = []; } diff --git a/src/OrchardCore/OrchardCore.Localization.Core/DataAnnotations/LocalizedDataAnnotationsMvcOptions.cs b/src/OrchardCore/OrchardCore.Localization.Core/DataAnnotations/LocalizedDataAnnotationsMvcOptions.cs index ed42b09093c..ea5f0c1eac7 100644 --- a/src/OrchardCore/OrchardCore.Localization.Core/DataAnnotations/LocalizedDataAnnotationsMvcOptions.cs +++ b/src/OrchardCore/OrchardCore.Localization.Core/DataAnnotations/LocalizedDataAnnotationsMvcOptions.cs @@ -4,7 +4,7 @@ namespace OrchardCore.Localization.DataAnnotations { - internal class LocalizedDataAnnotationsMvcOptions : IConfigureOptions + internal sealed class LocalizedDataAnnotationsMvcOptions : IConfigureOptions { private readonly IStringLocalizerFactory _stringLocalizerFactory; diff --git a/src/OrchardCore/OrchardCore.Localization.Core/PortableObject/PoParser.cs b/src/OrchardCore/OrchardCore.Localization.Core/PortableObject/PoParser.cs index 5bfaf8a3fb7..c04878f56de 100644 --- a/src/OrchardCore/OrchardCore.Localization.Core/PortableObject/PoParser.cs +++ b/src/OrchardCore/OrchardCore.Localization.Core/PortableObject/PoParser.cs @@ -138,7 +138,7 @@ var key when key.StartsWith("msgstr", StringComparison.Ordinal) => (PoContext.Tr }; } - private class DictionaryRecordBuilder + private sealed class DictionaryRecordBuilder { private readonly List _values; private IEnumerable _validValues => _values.Where(value => !string.IsNullOrEmpty(value)); diff --git a/src/OrchardCore/OrchardCore.Mvc.Core/LocationExpander/CompositeViewLocationExpanderProvider.cs b/src/OrchardCore/OrchardCore.Mvc.Core/LocationExpander/CompositeViewLocationExpanderProvider.cs index 8518c6fc4cd..d4438c4910c 100644 --- a/src/OrchardCore/OrchardCore.Mvc.Core/LocationExpander/CompositeViewLocationExpanderProvider.cs +++ b/src/OrchardCore/OrchardCore.Mvc.Core/LocationExpander/CompositeViewLocationExpanderProvider.cs @@ -6,7 +6,7 @@ namespace OrchardCore.Mvc.LocationExpander { - internal class CompositeViewLocationExpanderProvider : IViewLocationExpanderProvider + internal sealed class CompositeViewLocationExpanderProvider : IViewLocationExpanderProvider { public int Priority { diff --git a/src/OrchardCore/OrchardCore.Mvc.Core/RazorPages/PageEndpointComparerPolicy.cs b/src/OrchardCore/OrchardCore.Mvc.Core/RazorPages/PageEndpointComparerPolicy.cs index 04a8077e7d2..ff9ea35bc3b 100644 --- a/src/OrchardCore/OrchardCore.Mvc.Core/RazorPages/PageEndpointComparerPolicy.cs +++ b/src/OrchardCore/OrchardCore.Mvc.Core/RazorPages/PageEndpointComparerPolicy.cs @@ -12,7 +12,7 @@ public sealed class PageEndpointComparerPolicy : MatcherPolicy, IEndpointCompare public IComparer Comparer => new PageEndpointComparer(); - private class PageEndpointComparer : EndpointMetadataComparer + private sealed class PageEndpointComparer : EndpointMetadataComparer { protected override int CompareMetadata(PageActionDescriptor x, PageActionDescriptor y) { diff --git a/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Migrations/OpenIdMigrations.cs b/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Migrations/OpenIdMigrations.cs index afaf9d56254..e3c87fcebb6 100644 --- a/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Migrations/OpenIdMigrations.cs +++ b/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Migrations/OpenIdMigrations.cs @@ -172,9 +172,9 @@ await SchemaBuilder.AlterIndexTableAsync(table => table return 2; } - private class OpenIdApplicationByPostLogoutRedirectUriIndex { } - private class OpenIdApplicationByRedirectUriIndex { } - private class OpenIdApplicationByRoleNameIndex { } + private sealed class OpenIdApplicationByPostLogoutRedirectUriIndex { } + private sealed class OpenIdApplicationByRedirectUriIndex { } + private sealed class OpenIdApplicationByRoleNameIndex { } // This code can be removed in a later version. public async Task UpdateFrom2Async() @@ -402,7 +402,7 @@ await SchemaBuilder.AlterIndexTableAsync(table => tabl // This code can be removed in a later version. public async Task UpdateFrom7Async() { - // Create all index tables with the new collection value. + // Create all index tables with the new collection value. await SchemaBuilder.CreateMapIndexTableAsync(table => table .Column("ApplicationId", column => column.WithLength(48)) .Column("ClientId", column => column.Unique()), diff --git a/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Mappings/ContainedPartModel.cs b/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Mappings/ContainedPartModel.cs index 4e51c28f7df..147712c03fc 100644 --- a/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Mappings/ContainedPartModel.cs +++ b/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Mappings/ContainedPartModel.cs @@ -2,7 +2,7 @@ namespace OrchardCore.Search.Elasticsearch.Core.Mappings { - internal class ContainedPartModel + internal sealed class ContainedPartModel { [Keyword(Name = "Ids")] public string Ids { get; set; } diff --git a/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Mappings/DisplayTextModel.cs b/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Mappings/DisplayTextModel.cs index 2d7d5c8924c..601b2b744ff 100644 --- a/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Mappings/DisplayTextModel.cs +++ b/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Mappings/DisplayTextModel.cs @@ -2,7 +2,7 @@ namespace OrchardCore.Search.Elasticsearch.Core.Mappings { - internal class DisplayTextModel + internal sealed class DisplayTextModel { [Text(Name = "Analyzed")] public string Analyzed { get; set; } diff --git a/src/OrchardCore/OrchardCore/Locking/LocalLock.cs b/src/OrchardCore/OrchardCore/Locking/LocalLock.cs index caa5046e9be..cd69738e494 100644 --- a/src/OrchardCore/OrchardCore/Locking/LocalLock.cs +++ b/src/OrchardCore/OrchardCore/Locking/LocalLock.cs @@ -87,7 +87,7 @@ private Semaphore GetOrCreateSemaphore(string key) } } - private class Semaphore + private sealed class Semaphore { public Semaphore(string key, SemaphoreSlim value) { @@ -101,7 +101,7 @@ public Semaphore(string key, SemaphoreSlim value) internal int RefCount { get; set; } } - private class Locker : ILocker + private sealed class Locker : ILocker { private readonly LocalLock _localLock; private readonly Semaphore _semaphore; diff --git a/src/OrchardCore/OrchardCore/Modules/ModularBackgroundService.cs b/src/OrchardCore/OrchardCore/Modules/ModularBackgroundService.cs index 62714126e1f..b9cd33e8845 100644 --- a/src/OrchardCore/OrchardCore/Modules/ModularBackgroundService.cs +++ b/src/OrchardCore/OrchardCore/Modules/ModularBackgroundService.cs @@ -19,7 +19,7 @@ namespace OrchardCore.Modules { - internal class ModularBackgroundService : BackgroundService + internal sealed class ModularBackgroundService : BackgroundService { private static readonly TimeSpan _pollingTime = TimeSpan.FromMinutes(1); private static readonly TimeSpan _minIdleTime = TimeSpan.FromSeconds(10); diff --git a/src/OrchardCore/OrchardCore/Modules/PoweredByMiddleware.cs b/src/OrchardCore/OrchardCore/Modules/PoweredByMiddleware.cs index 744215038bb..f9680811e27 100644 --- a/src/OrchardCore/OrchardCore/Modules/PoweredByMiddleware.cs +++ b/src/OrchardCore/OrchardCore/Modules/PoweredByMiddleware.cs @@ -35,7 +35,7 @@ public interface IPoweredByMiddlewareOptions string HeaderValue { get; set; } } - internal class PoweredByMiddlewareOptions : IPoweredByMiddlewareOptions + internal sealed class PoweredByMiddlewareOptions : IPoweredByMiddlewareOptions { private const string PoweredByHeaderName = "X-Powered-By"; private const string PoweredByHeaderValue = "OrchardCore"; diff --git a/src/OrchardCore/OrchardCore/Shell/Builders/StartupBaseMock.cs b/src/OrchardCore/OrchardCore/Shell/Builders/StartupBaseMock.cs index 0d371658049..8d678a0b694 100644 --- a/src/OrchardCore/OrchardCore/Shell/Builders/StartupBaseMock.cs +++ b/src/OrchardCore/OrchardCore/Shell/Builders/StartupBaseMock.cs @@ -8,7 +8,7 @@ namespace OrchardCore.Environment.Shell.Builders { - internal class StartupBaseMock : StartupBase + internal sealed class StartupBaseMock : StartupBase { private readonly object _startup; private readonly MethodInfo _configureService; diff --git a/src/OrchardCore/OrchardCore/Shell/Descriptor/Settings/ConfiguredFeaturesShellDescriptorManager.cs b/src/OrchardCore/OrchardCore/Shell/Descriptor/Settings/ConfiguredFeaturesShellDescriptorManager.cs index 054c507c06f..53f2882fcca 100644 --- a/src/OrchardCore/OrchardCore/Shell/Descriptor/Settings/ConfiguredFeaturesShellDescriptorManager.cs +++ b/src/OrchardCore/OrchardCore/Shell/Descriptor/Settings/ConfiguredFeaturesShellDescriptorManager.cs @@ -63,7 +63,7 @@ public Task UpdateShellDescriptorAsync(int priorSerialNumber, IEnumerable /// Isolated context based on the default tenant settings used to resolve the . /// - internal class DistributedContext : IDisposable, IAsyncDisposable + internal sealed class DistributedContext : IDisposable, IAsyncDisposable { private readonly ShellContext _context; private volatile int _count; diff --git a/src/OrchardCore/OrchardCore/Shell/Distributed/DistributedShellHostedService.cs b/src/OrchardCore/OrchardCore/Shell/Distributed/DistributedShellHostedService.cs index 02ebbf30323..b78e1ec5797 100644 --- a/src/OrchardCore/OrchardCore/Shell/Distributed/DistributedShellHostedService.cs +++ b/src/OrchardCore/OrchardCore/Shell/Distributed/DistributedShellHostedService.cs @@ -16,7 +16,7 @@ namespace OrchardCore.Environment.Shell.Distributed /// /// Keep in sync tenants by sharing shell identifiers through an . /// - internal class DistributedShellHostedService : BackgroundService + internal sealed class DistributedShellHostedService : BackgroundService { private const string DistributedFeatureId = "OrchardCore.Tenants.Distributed"; diff --git a/src/OrchardCore/OrchardCore/Shell/Distributed/ShellIdentifier.cs b/src/OrchardCore/OrchardCore/Shell/Distributed/ShellIdentifier.cs index 9d6bd922e54..518e9a68ccb 100644 --- a/src/OrchardCore/OrchardCore/Shell/Distributed/ShellIdentifier.cs +++ b/src/OrchardCore/OrchardCore/Shell/Distributed/ShellIdentifier.cs @@ -1,6 +1,6 @@ namespace OrchardCore.Environment.Shell.Distributed { - internal class ShellIdentifier + internal sealed class ShellIdentifier { public string ReleaseId { get; set; } public string ReloadId { get; set; } diff --git a/test/OrchardCore.Benchmarks/Support/FakeFileProvider.cs b/test/OrchardCore.Benchmarks/Support/FakeFileProvider.cs index fc011b47734..2b58fddffb1 100644 --- a/test/OrchardCore.Benchmarks/Support/FakeFileProvider.cs +++ b/test/OrchardCore.Benchmarks/Support/FakeFileProvider.cs @@ -5,7 +5,7 @@ namespace OrchardCore.Benchmark.Support { - internal class FakeFileProvider : IFileProvider + internal sealed class FakeFileProvider : IFileProvider { public IDirectoryContents GetDirectoryContents(string subpath) { diff --git a/test/OrchardCore.Tests.Features/Examples.Features.AssyAttrib/Root.cs b/test/OrchardCore.Tests.Features/Examples.Features.AssyAttrib/Root.cs index 57a1f12c467..30bd702b09b 100644 --- a/test/OrchardCore.Tests.Features/Examples.Features.AssyAttrib/Root.cs +++ b/test/OrchardCore.Tests.Features/Examples.Features.AssyAttrib/Root.cs @@ -3,7 +3,7 @@ namespace Examples.Features.AssyAttrib /// /// Hooks provided for purposes of identifying the class and assembly context. /// - internal class Root + internal sealed class Root { } } diff --git a/test/OrchardCore.Tests.Modules/Errors.OrchardCoreModules.TwoPlus/Root.cs b/test/OrchardCore.Tests.Modules/Errors.OrchardCoreModules.TwoPlus/Root.cs index 90d603912bb..89e0aa79e5a 100644 --- a/test/OrchardCore.Tests.Modules/Errors.OrchardCoreModules.TwoPlus/Root.cs +++ b/test/OrchardCore.Tests.Modules/Errors.OrchardCoreModules.TwoPlus/Root.cs @@ -4,7 +4,7 @@ namespace Errors.OrchardCoreModules.TwoPlus /// /// Hooks provided for purposes of identifying the class and assembly context. /// - internal class Root + internal sealed class Root { } } diff --git a/test/OrchardCore.Tests.Modules/Examples.Modules.AssyAttrib.Alpha/Root.cs b/test/OrchardCore.Tests.Modules/Examples.Modules.AssyAttrib.Alpha/Root.cs index ad64f9c972b..97795e40c7e 100644 --- a/test/OrchardCore.Tests.Modules/Examples.Modules.AssyAttrib.Alpha/Root.cs +++ b/test/OrchardCore.Tests.Modules/Examples.Modules.AssyAttrib.Alpha/Root.cs @@ -3,7 +3,7 @@ namespace Examples.Modules.AssyAttrib.Alpha /// /// Hooks provided for purposes of identifying the class and assembly context. /// - internal class Root + internal sealed class Root { } } diff --git a/test/OrchardCore.Tests.Modules/Examples.Modules.AssyAttrib.Bravo/Root.cs b/test/OrchardCore.Tests.Modules/Examples.Modules.AssyAttrib.Bravo/Root.cs index 89de88f5bfa..6d5cf452738 100644 --- a/test/OrchardCore.Tests.Modules/Examples.Modules.AssyAttrib.Bravo/Root.cs +++ b/test/OrchardCore.Tests.Modules/Examples.Modules.AssyAttrib.Bravo/Root.cs @@ -3,7 +3,7 @@ namespace Examples.Modules.AssyAttrib.Bravo /// /// Hooks provided for purposes of identifying the class and assembly context. /// - internal class Root + internal sealed class Root { } } diff --git a/test/OrchardCore.Tests.Modules/Examples.Modules.AssyAttrib.Charlie/Root.cs b/test/OrchardCore.Tests.Modules/Examples.Modules.AssyAttrib.Charlie/Root.cs index 62ab0e968be..e39135c8784 100644 --- a/test/OrchardCore.Tests.Modules/Examples.Modules.AssyAttrib.Charlie/Root.cs +++ b/test/OrchardCore.Tests.Modules/Examples.Modules.AssyAttrib.Charlie/Root.cs @@ -3,7 +3,7 @@ namespace Examples.Modules.AssyAttrib.Charlie /// /// Hooks provided for purposes of identifying the class and assembly context. /// - internal class Root + internal sealed class Root { } } diff --git a/test/OrchardCore.Tests.Modules/Examples.OrchardCoreModules.Alpha/Root.cs b/test/OrchardCore.Tests.Modules/Examples.OrchardCoreModules.Alpha/Root.cs index 254e8984bac..bdc119b8cb3 100644 --- a/test/OrchardCore.Tests.Modules/Examples.OrchardCoreModules.Alpha/Root.cs +++ b/test/OrchardCore.Tests.Modules/Examples.OrchardCoreModules.Alpha/Root.cs @@ -3,7 +3,7 @@ namespace Examples.OrchardCoreModules.Alpha /// /// Hooks provided for purposes of identifying the class and assembly context. /// - internal class Root + internal sealed class Root { } } diff --git a/test/OrchardCore.Tests.Themes/Errors.OrchardCoreThemes.ThemeAndModule/Root.cs b/test/OrchardCore.Tests.Themes/Errors.OrchardCoreThemes.ThemeAndModule/Root.cs index 4723f33be55..509485a9328 100644 --- a/test/OrchardCore.Tests.Themes/Errors.OrchardCoreThemes.ThemeAndModule/Root.cs +++ b/test/OrchardCore.Tests.Themes/Errors.OrchardCoreThemes.ThemeAndModule/Root.cs @@ -4,7 +4,7 @@ namespace Errors.OrchardCoreThemes.ThemeAndModule /// /// Hooks provided for purposes of identifying the class and assembly context. /// - internal class Root + internal sealed class Root { } } diff --git a/test/OrchardCore.Tests.Themes/Errors.OrchardCoreThemes.TwoPlus/Root.cs b/test/OrchardCore.Tests.Themes/Errors.OrchardCoreThemes.TwoPlus/Root.cs index c5398485372..e2aac42decc 100644 --- a/test/OrchardCore.Tests.Themes/Errors.OrchardCoreThemes.TwoPlus/Root.cs +++ b/test/OrchardCore.Tests.Themes/Errors.OrchardCoreThemes.TwoPlus/Root.cs @@ -4,7 +4,7 @@ namespace Errors.OrchardCoreThemes.TwoPlus /// /// Hooks provided for purposes of identifying the class and assembly context. /// - internal class Root + internal sealed class Root { } } diff --git a/test/OrchardCore.Tests.Themes/Examples.OrchardCoreThemes.Alpha/Root.cs b/test/OrchardCore.Tests.Themes/Examples.OrchardCoreThemes.Alpha/Root.cs index 458a55ed596..6dffccf0752 100644 --- a/test/OrchardCore.Tests.Themes/Examples.OrchardCoreThemes.Alpha/Root.cs +++ b/test/OrchardCore.Tests.Themes/Examples.OrchardCoreThemes.Alpha/Root.cs @@ -3,7 +3,7 @@ namespace Examples.OrchardCoreThemes.Alpha /// /// Hooks provided for purposes of identifying the class and assembly context. /// - internal class Root + internal sealed class Root { } } diff --git a/test/OrchardCore.Tests.Themes/Examples.Themes.AssyAttrib.Alpha/Root.cs b/test/OrchardCore.Tests.Themes/Examples.Themes.AssyAttrib.Alpha/Root.cs index e50b306d9c1..8793a663963 100644 --- a/test/OrchardCore.Tests.Themes/Examples.Themes.AssyAttrib.Alpha/Root.cs +++ b/test/OrchardCore.Tests.Themes/Examples.Themes.AssyAttrib.Alpha/Root.cs @@ -3,7 +3,7 @@ namespace Examples.Themes.AssyAttrib.Alpha /// /// Hooks provided for purposes of identifying the class and assembly context. /// - internal class Root + internal sealed class Root { } } diff --git a/test/OrchardCore.Tests.Themes/Examples.Themes.AssyAttrib.Bravo/Root.cs b/test/OrchardCore.Tests.Themes/Examples.Themes.AssyAttrib.Bravo/Root.cs index 106aa26ca01..8cae58487e5 100644 --- a/test/OrchardCore.Tests.Themes/Examples.Themes.AssyAttrib.Bravo/Root.cs +++ b/test/OrchardCore.Tests.Themes/Examples.Themes.AssyAttrib.Bravo/Root.cs @@ -3,7 +3,7 @@ namespace Examples.Themes.AssyAttrib.Bravo /// /// Hooks provided for purposes of identifying the class and assembly context. /// - internal class Root + internal sealed class Root { } } diff --git a/test/OrchardCore.Tests.Themes/Examples.Themes.AssyAttrib.Charlie/Root.cs b/test/OrchardCore.Tests.Themes/Examples.Themes.AssyAttrib.Charlie/Root.cs index 3bdf48abc93..257e3e35e8b 100644 --- a/test/OrchardCore.Tests.Themes/Examples.Themes.AssyAttrib.Charlie/Root.cs +++ b/test/OrchardCore.Tests.Themes/Examples.Themes.AssyAttrib.Charlie/Root.cs @@ -3,7 +3,7 @@ namespace Examples.Themes.AssyAttrib.Charlie /// /// Hooks provided for purposes of identifying the class and assembly context. /// - internal class Root + internal sealed class Root { } } diff --git a/test/OrchardCore.Tests/Apis/Context/AuthenticationContext.cs b/test/OrchardCore.Tests/Apis/Context/AuthenticationContext.cs index a28a2e71204..22ec2155240 100644 --- a/test/OrchardCore.Tests/Apis/Context/AuthenticationContext.cs +++ b/test/OrchardCore.Tests/Apis/Context/AuthenticationContext.cs @@ -3,7 +3,7 @@ namespace OrchardCore.Tests.Apis.Context { - internal class PermissionContextAuthorizationHandler : AuthorizationHandler + internal sealed class PermissionContextAuthorizationHandler : AuthorizationHandler { private readonly PermissionsContext _permissionsContext; @@ -96,7 +96,7 @@ public class PermissionsContext public bool UsePermissionsContext { get; set; } = false; } - internal class StubIdentity : IIdentity + internal sealed class StubIdentity : IIdentity { public string AuthenticationType => "TEST TEST"; diff --git a/test/OrchardCore.Tests/Apis/Context/SiteStartup.cs b/test/OrchardCore.Tests/Apis/Context/SiteStartup.cs index e021dea84ae..d130cdc7d99 100644 --- a/test/OrchardCore.Tests/Apis/Context/SiteStartup.cs +++ b/test/OrchardCore.Tests/Apis/Context/SiteStartup.cs @@ -45,7 +45,7 @@ public void Configure(IApplicationBuilder app) app.UseOrchardCore(); } - private class ModuleNamesProvider : IModuleNamesProvider + private sealed class ModuleNamesProvider : IModuleNamesProvider { private readonly string[] _moduleNames; diff --git a/test/OrchardCore.Tests/Apis/Context/TablePrefixGenerator.cs b/test/OrchardCore.Tests/Apis/Context/TablePrefixGenerator.cs index e3687cc8db3..485241cc3ca 100644 --- a/test/OrchardCore.Tests/Apis/Context/TablePrefixGenerator.cs +++ b/test/OrchardCore.Tests/Apis/Context/TablePrefixGenerator.cs @@ -7,7 +7,7 @@ namespace OrchardCore.Tests.Apis.Context /// /// Does not guarantee uniqueness. /// - internal class TablePrefixGenerator + internal sealed class TablePrefixGenerator { private static readonly char[] _charList = "abcdefghijklmnopqrstuvwxyz".ToCharArray(); diff --git a/test/OrchardCore.Tests/Apis/GraphQL/ValidationRules/RequiresPermissionValidationRuleTests.cs b/test/OrchardCore.Tests/Apis/GraphQL/ValidationRules/RequiresPermissionValidationRuleTests.cs index bbd24fb2a83..161e7b0f84d 100644 --- a/test/OrchardCore.Tests/Apis/GraphQL/ValidationRules/RequiresPermissionValidationRuleTests.cs +++ b/test/OrchardCore.Tests/Apis/GraphQL/ValidationRules/RequiresPermissionValidationRuleTests.cs @@ -131,7 +131,7 @@ private static ExecutionOptions BuildExecutionOptions(string query, PermissionsC }; } - private class ValidationSchema : Schema + private sealed class ValidationSchema : Schema { public ValidationSchema() { @@ -141,7 +141,7 @@ public ValidationSchema() } } - private class ValidationQueryRoot : ObjectGraphType + private sealed class ValidationQueryRoot : ObjectGraphType { public ValidationQueryRoot() { @@ -151,7 +151,7 @@ public ValidationQueryRoot() } } - private class TestField : ObjectGraphType + private sealed class TestField : ObjectGraphType { public TestField() { diff --git a/test/OrchardCore.Tests/DisplayManagement/Decriptors/DefaultShapeTableManagerTests.cs b/test/OrchardCore.Tests/DisplayManagement/Decriptors/DefaultShapeTableManagerTests.cs index 16b1ab33d30..391cb7cf62c 100644 --- a/test/OrchardCore.Tests/DisplayManagement/Decriptors/DefaultShapeTableManagerTests.cs +++ b/test/OrchardCore.Tests/DisplayManagement/Decriptors/DefaultShapeTableManagerTests.cs @@ -15,7 +15,7 @@ public class DefaultShapeTableManagerTests : IDisposable { private readonly IServiceProvider _serviceProvider; - private class TestModuleExtensionInfo : IExtensionInfo + private sealed class TestModuleExtensionInfo : IExtensionInfo { public TestModuleExtensionInfo(string name) { @@ -49,7 +49,7 @@ public TestModuleExtensionInfo(string name) public bool Exists => true; } - private class TestThemeExtensionInfo : IThemeExtensionInfo + private sealed class TestThemeExtensionInfo : IThemeExtensionInfo { public TestThemeExtensionInfo(string name) { diff --git a/test/OrchardCore.Tests/DisplayManagement/DefaultDisplayManagerTests.cs b/test/OrchardCore.Tests/DisplayManagement/DefaultDisplayManagerTests.cs index b693155fdf0..8fc3a58b0f0 100644 --- a/test/OrchardCore.Tests/DisplayManagement/DefaultDisplayManagerTests.cs +++ b/test/OrchardCore.Tests/DisplayManagement/DefaultDisplayManagerTests.cs @@ -44,7 +44,7 @@ public DefaultDisplayManagerTests() _serviceProvider = serviceCollection.BuildServiceProvider(); } - private class TestDisplayEvents : IShapeDisplayEvents + private sealed class TestDisplayEvents : IShapeDisplayEvents { public Action Displaying = ctx => { }; public Action Displayed = ctx => { }; diff --git a/test/OrchardCore.Tests/DisplayManagement/ShapeFactoryTests.cs b/test/OrchardCore.Tests/DisplayManagement/ShapeFactoryTests.cs index bf11366b968..e656f4cead5 100644 --- a/test/OrchardCore.Tests/DisplayManagement/ShapeFactoryTests.cs +++ b/test/OrchardCore.Tests/DisplayManagement/ShapeFactoryTests.cs @@ -126,7 +126,7 @@ public async Task ShapeFactoryWithCustomShapeTypeAppliesArguments() Assert.Equal("Baz", foo.Baz); } - private class SubShape : Shape + private sealed class SubShape : Shape { } } diff --git a/test/OrchardCore.Tests/Email/EmailAddressValidatorTests.cs b/test/OrchardCore.Tests/Email/EmailAddressValidatorTests.cs index 3ea78a3080d..ec477eeb8b2 100644 --- a/test/OrchardCore.Tests/Email/EmailAddressValidatorTests.cs +++ b/test/OrchardCore.Tests/Email/EmailAddressValidatorTests.cs @@ -31,7 +31,7 @@ public void UseCustomEmailAddressValidator(string address, bool isValid) Assert.Equal(isValid, emailAddressValidator.Validate(address)); } - private class OrchardCoreEmailValidator : IEmailAddressValidator + private sealed class OrchardCoreEmailValidator : IEmailAddressValidator { public bool Validate(string emailAddress) => emailAddress.EndsWith("@orchardcore.net"); diff --git a/test/OrchardCore.Tests/Extensions/ExtensionManagerTests.cs b/test/OrchardCore.Tests/Extensions/ExtensionManagerTests.cs index 1135d2f8872..1ae8e2bfd45 100644 --- a/test/OrchardCore.Tests/Extensions/ExtensionManagerTests.cs +++ b/test/OrchardCore.Tests/Extensions/ExtensionManagerTests.cs @@ -55,7 +55,7 @@ public ExtensionManagerTests() ); } - private class ModuleNamesProvider : IModuleNamesProvider + private sealed class ModuleNamesProvider : IModuleNamesProvider { private readonly string[] _moduleNames; diff --git a/test/OrchardCore.Tests/Modules/OrchardCore.Email/Workflows/EmailTaskTests.cs b/test/OrchardCore.Tests/Modules/OrchardCore.Email/Workflows/EmailTaskTests.cs index 5286a130edc..8e59910f676 100644 --- a/test/OrchardCore.Tests/Modules/OrchardCore.Email/Workflows/EmailTaskTests.cs +++ b/test/OrchardCore.Tests/Modules/OrchardCore.Email/Workflows/EmailTaskTests.cs @@ -79,7 +79,7 @@ private static DefaultEmailService CreateSmtpService(SmtpOptions smtpOptions) emailServiceLocalizer.Object); } - private class SimpleWorkflowExpressionEvaluator : IWorkflowExpressionEvaluator + private sealed class SimpleWorkflowExpressionEvaluator : IWorkflowExpressionEvaluator { public async Task EvaluateAsync(WorkflowExpression expression, WorkflowExecutionContext workflowContext, TextEncoder encoder) => await Task.FromResult((T)Convert.ChangeType(expression.Expression, typeof(T))); diff --git a/test/OrchardCore.Tests/Modules/OrchardCore.OpenId/OpenIdApplicationStepTestsData.cs b/test/OrchardCore.Tests/Modules/OrchardCore.OpenId/OpenIdApplicationStepTestsData.cs index 390189c499e..7bf842091ca 100644 --- a/test/OrchardCore.Tests/Modules/OrchardCore.OpenId/OpenIdApplicationStepTestsData.cs +++ b/test/OrchardCore.Tests/Modules/OrchardCore.OpenId/OpenIdApplicationStepTestsData.cs @@ -2,7 +2,7 @@ namespace OrchardCore.Tests.Modules.OrchardCore.OpenId { - internal class OpenIdApplicationStepTestsData + internal sealed class OpenIdApplicationStepTestsData : TheoryData { public OpenIdApplicationStepTestsData() diff --git a/test/OrchardCore.Tests/Modules/OrchardCore.Tenants/ApiControllerTests.cs b/test/OrchardCore.Tests/Modules/OrchardCore.Tenants/ApiControllerTests.cs index a7a95049239..81ad7396632 100644 --- a/test/OrchardCore.Tests/Modules/OrchardCore.Tenants/ApiControllerTests.cs +++ b/test/OrchardCore.Tests/Modules/OrchardCore.Tenants/ApiControllerTests.cs @@ -197,7 +197,7 @@ private static HttpContext CreateHttpContext() return httpContext; } - private class FakeDataProtector : IDataProtector + private sealed class FakeDataProtector : IDataProtector { public IDataProtector CreateProtector(string purpose) => this; diff --git a/test/OrchardCore.Tests/Recipes/RecipeExecutorTests.cs b/test/OrchardCore.Tests/Recipes/RecipeExecutorTests.cs index 17d67f131b6..3bcdd2d742d 100644 --- a/test/OrchardCore.Tests/Recipes/RecipeExecutorTests.cs +++ b/test/OrchardCore.Tests/Recipes/RecipeExecutorTests.cs @@ -72,7 +72,7 @@ private IFileInfo GetRecipeFileInfo(string recipeName) return new EmbeddedFileProvider(assembly).GetFileInfo(path); } - private class RecipeEventHandler : IRecipeEventHandler + private sealed class RecipeEventHandler : IRecipeEventHandler { public RecipeExecutionContext Context { get; private set; } diff --git a/test/OrchardCore.Tests/ResourceManagement/ResourceDefinitionTests.cs b/test/OrchardCore.Tests/ResourceManagement/ResourceDefinitionTests.cs index 13b2bbc6d01..845053cd42a 100644 --- a/test/OrchardCore.Tests/ResourceManagement/ResourceDefinitionTests.cs +++ b/test/OrchardCore.Tests/ResourceManagement/ResourceDefinitionTests.cs @@ -283,7 +283,7 @@ private static string ReadIHtmlContent(IHtmlContent content) #endregion #region Stubs - private class StubFileVersionProvider : IFileVersionProvider + private sealed class StubFileVersionProvider : IFileVersionProvider { public static StubFileVersionProvider Instance { get; } = new StubFileVersionProvider(); diff --git a/test/OrchardCore.Tests/ResourceManagement/ResourceManagerTests.cs b/test/OrchardCore.Tests/ResourceManagement/ResourceManagerTests.cs index f6f1a8a8dfc..faae186a564 100644 --- a/test/OrchardCore.Tests/ResourceManagement/ResourceManagerTests.cs +++ b/test/OrchardCore.Tests/ResourceManagement/ResourceManagerTests.cs @@ -900,7 +900,7 @@ private async Task ParseHtmlAsync(IHtmlContent content) #endregion #region Stubs - private class StubResourceManifestProvider : IConfigureOptions + private sealed class StubResourceManifestProvider : IConfigureOptions { private readonly Action _configureManifestAction; @@ -915,7 +915,7 @@ public void Configure(ResourceManagementOptions options) } } - private class StubFileVersionProvider : IFileVersionProvider + private sealed class StubFileVersionProvider : IFileVersionProvider { public static StubFileVersionProvider Instance { get; } = new StubFileVersionProvider(); diff --git a/test/OrchardCore.Tests/Routing/AutorouteEntriesTests.cs b/test/OrchardCore.Tests/Routing/AutorouteEntriesTests.cs index 17319ba1936..b9dc80f0c85 100644 --- a/test/OrchardCore.Tests/Routing/AutorouteEntriesTests.cs +++ b/test/OrchardCore.Tests/Routing/AutorouteEntriesTests.cs @@ -247,7 +247,7 @@ public interface IStubAutorouteEntries : IAutorouteEntries void RemoveEntries(IEnumerable entries); } - private class StubAutorouteEntries : AutorouteEntries, IStubAutorouteEntries + private sealed class StubAutorouteEntries : AutorouteEntries, IStubAutorouteEntries { public StubAutorouteEntries() : base(null) { } public new void AddEntries(IEnumerable entries) => base.AddEntries(entries); diff --git a/test/OrchardCore.Tests/Security/PermissionHandlerHelper.cs b/test/OrchardCore.Tests/Security/PermissionHandlerHelper.cs index a37386bb05f..7da5a4f5a6c 100644 --- a/test/OrchardCore.Tests/Security/PermissionHandlerHelper.cs +++ b/test/OrchardCore.Tests/Security/PermissionHandlerHelper.cs @@ -33,7 +33,7 @@ public static async Task SuccessAsync(this AuthorizationHandlerContext context, await handler.HandleAsync(context); } - private class FakePermissionHandler : AuthorizationHandler + private sealed class FakePermissionHandler : AuthorizationHandler { private readonly HashSet _permissionNames; diff --git a/test/OrchardCore.Tests/Shell/ShellContainerFactoryTests.cs b/test/OrchardCore.Tests/Shell/ShellContainerFactoryTests.cs index 50174c4b68d..1f4f978d09f 100644 --- a/test/OrchardCore.Tests/Shell/ShellContainerFactoryTests.cs +++ b/test/OrchardCore.Tests/Shell/ShellContainerFactoryTests.cs @@ -170,15 +170,15 @@ private interface ITestService { } - private class TestService : ITestService + private sealed class TestService : ITestService { } - private class CustomTestService : ITestService + private sealed class CustomTestService : ITestService { } - private class RegisterServiceStartup : StartupBase + private sealed class RegisterServiceStartup : StartupBase { public override int Order => 1; @@ -188,7 +188,7 @@ public override void ConfigureServices(IServiceCollection services) } } - private class ReplaceServiceStartup : StartupBase + private sealed class ReplaceServiceStartup : StartupBase { public override int Order => 2; @@ -204,31 +204,31 @@ private interface ITestTransient { } private interface ITestScoped { } - private class TestSingleton : ITestSingleton { } + private sealed class TestSingleton : ITestSingleton { } - private class TestTransient : ITestTransient { } + private sealed class TestTransient : ITestTransient { } - private class TestScoped : ITestScoped { } + private sealed class TestScoped : ITestScoped { } private interface ITwoHostSingletonsOfTheSameType { } - private class FirstHostSingletonsOfTheSameType : ITwoHostSingletonsOfTheSameType { } + private sealed class FirstHostSingletonsOfTheSameType : ITwoHostSingletonsOfTheSameType { } - private class SecondHostSingletonsOfTheSameType : ITwoHostSingletonsOfTheSameType { } + private sealed class SecondHostSingletonsOfTheSameType : ITwoHostSingletonsOfTheSameType { } - private class ShellSingletonOfTheSametype : ITwoHostSingletonsOfTheSameType { } + private sealed class ShellSingletonOfTheSametype : ITwoHostSingletonsOfTheSameType { } - private class ShellTransientOfTheSametype : ITwoHostSingletonsOfTheSameType { } + private sealed class ShellTransientOfTheSametype : ITwoHostSingletonsOfTheSameType { } - private class ShellScopedOfTheSametype : ITwoHostSingletonsOfTheSameType { } + private sealed class ShellScopedOfTheSametype : ITwoHostSingletonsOfTheSameType { } private interface IHostSingletonAndScopedOfTheSameType { } - private class HostSingletonOfTheSameTypeAsScoped : IHostSingletonAndScopedOfTheSameType { } + private sealed class HostSingletonOfTheSameTypeAsScoped : IHostSingletonAndScopedOfTheSameType { } - private class HostScopedOfTheSameTypeAsSingleton : IHostSingletonAndScopedOfTheSameType { } + private sealed class HostScopedOfTheSameTypeAsSingleton : IHostSingletonAndScopedOfTheSameType { } - private class ServicesOfTheSameTypeStartup : StartupBase + private sealed class ServicesOfTheSameTypeStartup : StartupBase { public override int Order => 1;