diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Services/IContentDefinitionService.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Services/IContentDefinitionService.cs index a9358d426d8..0d8c4d50d8b 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Services/IContentDefinitionService.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Services/IContentDefinitionService.cs @@ -57,104 +57,4 @@ public interface IContentDefinitionService Task AlterTypePartsOrderAsync(ContentTypeDefinition typeDefinition, string[] partNames); Task AlterPartFieldsOrderAsync(ContentPartDefinition partDefinition, string[] fieldNames); - - [Obsolete($"Instead, utilize the {nameof(LoadTypesAsync)} method. This current method is slated for removal in upcoming releases.")] - IEnumerable LoadTypes() -=> LoadTypesAsync().GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(GetTypesAsync)} method. This current method is slated for removal in upcoming releases.")] - IEnumerable GetTypes() - => GetTypesAsync().GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(LoadTypeAsync)} method. This current method is slated for removal in upcoming releases.")] - EditTypeViewModel LoadType(string name) - => LoadTypeAsync(name).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(GetTypeAsync)} method. This current method is slated for removal in upcoming releases.")] - EditTypeViewModel GetType(string name) - => GetTypeAsync(name).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(AddTypeAsync)} method. This current method is slated for removal in upcoming releases.")] - ContentTypeDefinition AddType(string name, string displayName) - => AddTypeAsync(name, displayName).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(RemoveTypeAsync)} method. This current method is slated for removal in upcoming releases.")] - void RemoveType(string name, bool deleteContent) - => RemoveTypeAsync(name, deleteContent).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(AddPartToTypeAsync)} method. This current method is slated for removal in upcoming releases.")] - void AddPartToType(string partName, string typeName) - => AddPartToTypeAsync(partName, typeName).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(AddReusablePartToTypeAsync)} method. This current method is slated for removal in upcoming releases.")] - void AddReusablePartToType(string name, string displayName, string description, string partName, string typeName) - => AddReusablePartToTypeAsync(name, displayName, description, partName, typeName).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(RemovePartFromTypeAsync)} method. This current method is slated for removal in upcoming releases.")] - void RemovePartFromType(string partName, string typeName) - => RemovePartFromTypeAsync(partName, typeName); - - [Obsolete($"Instead, utilize the {nameof(GenerateContentTypeNameFromDisplayNameAsync)} method. This current method is slated for removal in upcoming releases.")] - string GenerateContentTypeNameFromDisplayName(string displayName) - => GenerateContentTypeNameFromDisplayNameAsync(displayName).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(GenerateFieldNameFromDisplayNameAsync)} method. This current method is slated for removal in upcoming releases.")] - string GenerateFieldNameFromDisplayName(string partName, string displayName) - => GenerateFieldNameFromDisplayNameAsync(partName, displayName).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(LoadPartsAsync)} method. This current method is slated for removal in upcoming releases.")] - IEnumerable LoadParts(bool metadataPartsOnly) - => LoadPartsAsync(metadataPartsOnly).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(GetPartsAsync)} method. This current method is slated for removal in upcoming releases.")] - IEnumerable GetParts(bool metadataPartsOnly) - => GetPartsAsync(metadataPartsOnly).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(LoadPartAsync)} method. This current method is slated for removal in upcoming releases.")] - EditPartViewModel LoadPart(string name) - => LoadPartAsync(name).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(GetPartAsync)} method. This current method is slated for removal in upcoming releases.")] - EditPartViewModel GetPart(string name) - => GetPartAsync(name).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(AddPartAsync)} method. This current method is slated for removal in upcoming releases.")] - EditPartViewModel AddPart(CreatePartViewModel partViewModel) - => AddPartAsync(partViewModel).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(RemovePartAsync)} method. This current method is slated for removal in upcoming releases.")] - void RemovePart(string name) - => RemovePartAsync(name).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(GetFieldsAsync)} method. This current method is slated for removal in upcoming releases.")] - IEnumerable GetFields() - => GetFieldsAsync().GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(AddFieldToPartAsync)} method. This current method is slated for removal in upcoming releases.")] - void AddFieldToPart(string fieldName, string fieldTypeName, string partName) - => AddFieldToPartAsync(fieldName, fieldTypeName, partName).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(AddFieldToPartAsync)} method. This current method is slated for removal in upcoming releases.")] - void AddFieldToPart(string fieldName, string displayName, string fieldTypeName, string partName) - => AddFieldToPartAsync(fieldName, displayName, fieldTypeName, partName).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(RemoveFieldFromPartAsync)} method. This current method is slated for removal in upcoming releases.")] - void RemoveFieldFromPart(string fieldName, string partName) - => RemoveFieldFromPartAsync(fieldName, partName).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(AlterFieldAsync)} method. This current method is slated for removal in upcoming releases.")] - void AlterField(EditPartViewModel partViewModel, EditFieldViewModel fieldViewModel) - => AlterFieldAsync(partViewModel, fieldViewModel).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(AlterTypePartAsync)} method. This current method is slated for removal in upcoming releases.")] - void AlterTypePart(EditTypePartViewModel partViewModel) - => AlterTypePartAsync(partViewModel).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(AlterTypePartsOrderAsync)} method. This current method is slated for removal in upcoming releases.")] - void AlterTypePartsOrder(ContentTypeDefinition typeDefinition, string[] partNames) - => AlterTypePartsOrderAsync(typeDefinition, partNames).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(AlterPartFieldsOrderAsync)} method. This current method is slated for removal in upcoming releases.")] - void AlterPartFieldsOrder(ContentPartDefinition partDefinition, string[] fieldNames) - => AlterPartFieldsOrderAsync(partDefinition, fieldNames).GetAwaiter().GetResult(); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Services/IStereotypeService.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Services/IStereotypeService.cs index 069bd333a16..1e5d99dfd6e 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Services/IStereotypeService.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Services/IStereotypeService.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,8 +6,4 @@ namespace OrchardCore.ContentTypes.Services; public interface IStereotypeService { Task> GetStereotypesAsync(); - - [Obsolete($"Instead, utilize the {nameof(GetStereotypesAsync)} method. This current method is slated for removal in upcoming releases.")] - IEnumerable GetStereotypes() - => GetStereotypesAsync().GetAwaiter().GetResult(); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Services/IStereotypesProvider.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Services/IStereotypesProvider.cs index 10b3f06b44d..8c4b997334c 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Services/IStereotypesProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Services/IStereotypesProvider.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,8 +6,4 @@ namespace OrchardCore.ContentTypes.Services; public interface IStereotypesProvider { Task> GetStereotypesAsync(); - - [Obsolete($"Instead, utilize the {nameof(GetStereotypesAsync)} method. This current method is slated for removal in upcoming releases.")] - IEnumerable GetStereotypes() - => GetStereotypesAsync().GetAwaiter().GetResult(); } diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/ViewModels/SelectContentTypesViewModel.cs b/src/OrchardCore.Modules/OrchardCore.Contents/ViewModels/SelectContentTypesViewModel.cs index 1a4ff7d0f39..a05e7f86349 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/ViewModels/SelectContentTypesViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/ViewModels/SelectContentTypesViewModel.cs @@ -18,10 +18,6 @@ public class ContentTypeSelection public bool IsSelected { get; set; } public ContentTypeDefinition ContentTypeDefinition { get; set; } - [Obsolete($"Instead, utilize the {nameof(BuildAsync)} method. This current method is slated for removal in upcoming releases.")] - public static ContentTypeSelection[] Build(IContentDefinitionManager contentDefinitionManager, IEnumerable selectedContentTypes) - => BuildAsync(contentDefinitionManager, selectedContentTypes).GetAwaiter().GetResult(); - public static async Task BuildAsync(IContentDefinitionManager contentDefinitionManager, IEnumerable selectedContentTypes) { var contentTypes = (await contentDefinitionManager.ListTypeDefinitionsAsync()) diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Drivers/ContentEventDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Drivers/ContentEventDisplayDriver.cs index 6b0408f94d2..11539884630 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Drivers/ContentEventDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Drivers/ContentEventDisplayDriver.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -31,7 +30,7 @@ public async override Task UpdateAsync(TActivity model, IUpdateM await updater.TryUpdateModelAsync(viewModel, Prefix, x => x.SelectedContentTypeNames); model.ContentTypeFilter = (await FilterContentTypesQueryAsync(viewModel.SelectedContentTypeNames)).ToList(); - + return Edit(model); } @@ -55,13 +54,6 @@ public override IDisplayResult Display(TActivity activity) ); } - /// - /// Filters out any content type that doesn't exist. - /// - [Obsolete($"Instead, utilize the {nameof(FilterContentTypesQueryAsync)} method. This current method is slated for removal in upcoming releases.")] - protected IEnumerable FilterContentTypesQuery(IEnumerable contentTypeNames) - => FilterContentTypesQueryAsync(contentTypeNames).GetAwaiter().GetResult(); - protected async Task> FilterContentTypesQueryAsync(IEnumerable contentTypeNames) { var contentTypeDefinitions = (await ContentDefinitionManager.ListTypeDefinitionsAsync()).ToDictionary(x => x.Name); diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/FormShapeTableProvider.cs b/src/OrchardCore.Modules/OrchardCore.Forms/FormShapeTableProvider.cs index e31fc981180..aa7973461ea 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/FormShapeTableProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.Forms/FormShapeTableProvider.cs @@ -1,3 +1,4 @@ +using System.Threading.Tasks; using OrchardCore.ContentManagement; using OrchardCore.DisplayManagement; using OrchardCore.DisplayManagement.Descriptors; @@ -8,17 +9,19 @@ namespace OrchardCore.Forms; public class FormShapeTableProvider : IShapeTableProvider { - public void Discover(ShapeTableBuilder builder) + public ValueTask DiscoverAsync(ShapeTableBuilder builder) { builder.Describe("Widget__Form") .OnDisplaying(context => { - if (context.Shape.TryGetProperty("ContentItem", out var contentItem) - && contentItem.TryGet(out var elementPart) + if (context.Shape.TryGetProperty("ContentItem", out var contentItem) + && contentItem.TryGet(out var elementPart) && !string.IsNullOrEmpty(elementPart.Id)) { context.Shape.Metadata.Alternates.Add($"Widget__{contentItem.ContentType}_{elementPart.Id.EncodeAlternateElement()}"); } }); + + return ValueTask.CompletedTask; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Layers/GraphQL/LayerQueryObjectType.cs b/src/OrchardCore.Modules/OrchardCore.Layers/GraphQL/LayerQueryObjectType.cs index aabec619a61..a2d65e389a1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Layers/GraphQL/LayerQueryObjectType.cs +++ b/src/OrchardCore.Modules/OrchardCore.Layers/GraphQL/LayerQueryObjectType.cs @@ -23,9 +23,6 @@ public LayerQueryObjectType() Name = "Layer"; Field(layer => layer.Name).Description("The name of the layer."); -#pragma warning disable 0618 - Field(layer => layer.Rule).Description("Deprecated. The rule that activates the layer."); -#pragma warning restore 0618 Field, IEnumerable>("layerrule") .Description("The rule that activates the layer.") .Resolve(ctx => ctx.Source.LayerRule.Conditions); diff --git a/src/OrchardCore.Modules/OrchardCore.Layers/Migrations.cs b/src/OrchardCore.Modules/OrchardCore.Layers/Migrations.cs index 5a8339d0399..12c3d5dc902 100644 --- a/src/OrchardCore.Modules/OrchardCore.Layers/Migrations.cs +++ b/src/OrchardCore.Modules/OrchardCore.Layers/Migrations.cs @@ -2,7 +2,6 @@ using OrchardCore.Data.Migration; using OrchardCore.Layers.Indexes; using OrchardCore.Layers.Services; -using OrchardCore.Rules; using OrchardCore.Rules.Services; using YesSql.Sql; @@ -12,16 +11,13 @@ public class Migrations : DataMigration { private readonly ILayerService _layerService; private readonly IConditionIdGenerator _conditionIdGenerator; - private readonly IRuleMigrator _ruleMigrator; public Migrations( ILayerService layerService, - IConditionIdGenerator conditionIdGenerator, - IRuleMigrator ruleMigrator) + IConditionIdGenerator conditionIdGenerator) { _layerService = layerService; _conditionIdGenerator = conditionIdGenerator; - _ruleMigrator = ruleMigrator; } public async Task CreateAsync() @@ -49,26 +45,8 @@ await SchemaBuilder.AlterIndexTableAsync(table => table "Zone") ); - return 2; - } - - public async Task UpdateFrom2Async() - { - var layers = await _layerService.LoadLayersAsync(); - foreach (var layer in layers.Layers) - { - layer.LayerRule = new Rule(); - _conditionIdGenerator.GenerateUniqueId(layer.LayerRule); - -#pragma warning disable 0618 - _ruleMigrator.Migrate(layer.Rule, layer.LayerRule); - - layer.Rule = string.Empty; -#pragma warning restore 0618 - } - - await _layerService.UpdateAsync(layers); - + // Migration was cleaned up in version 2.0. + // Jump to step 3 during create. return 3; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Layers/Models/Layer.cs b/src/OrchardCore.Modules/OrchardCore.Layers/Models/Layer.cs index 26a0de519fd..a0f9949f4d3 100644 --- a/src/OrchardCore.Modules/OrchardCore.Layers/Models/Layer.cs +++ b/src/OrchardCore.Modules/OrchardCore.Layers/Models/Layer.cs @@ -1,4 +1,3 @@ -using System; using OrchardCore.Rules; namespace OrchardCore.Layers.Models @@ -7,12 +6,6 @@ public class Layer { public string Name { get; set; } - /// - /// This property is obsolete and layer rules should be used instead. - /// It can be removed in a future version. - /// - [Obsolete("The rule property is obsolete and LayerRule should be used instead.")] - public string Rule { get; set; } public string Description { get; set; } public Rule LayerRule { get; set; } diff --git a/src/OrchardCore.Modules/OrchardCore.Layers/Recipes/LayerStep.cs b/src/OrchardCore.Modules/OrchardCore.Layers/Recipes/LayerStep.cs index 98eb7963c47..68359a3b1a6 100644 --- a/src/OrchardCore.Modules/OrchardCore.Layers/Recipes/LayerStep.cs +++ b/src/OrchardCore.Modules/OrchardCore.Layers/Recipes/LayerStep.cs @@ -21,20 +21,17 @@ namespace OrchardCore.Layers.Recipes public class LayerStep : IRecipeStepHandler { private readonly ILayerService _layerService; - private readonly IRuleMigrator _ruleMigrator; private readonly IConditionIdGenerator _conditionIdGenerator; private readonly IEnumerable _factories; private readonly JsonSerializerOptions _serializationOptions; public LayerStep( ILayerService layerService, - IRuleMigrator ruleMigrator, IConditionIdGenerator conditionIdGenerator, IEnumerable factories, IOptions serializationOptions) { _layerService = layerService; - _ruleMigrator = ruleMigrator; _conditionIdGenerator = conditionIdGenerator; _factories = factories; _serializationOptions = serializationOptions.Value.SerializerOptions; @@ -107,13 +104,6 @@ public async Task ExecuteAsync(RecipeExecutionContext context) } } - // Migrate any old rule in a recipe to the new rule format. - // Do not import the old rule. - if (!string.IsNullOrEmpty(layerStep.Rule)) - { - _ruleMigrator.Migrate(layerStep.Rule, layer.LayerRule); - } - if (!string.IsNullOrEmpty(layerStep.Description)) { layer.Description = layerStep.Description; diff --git a/src/OrchardCore.Modules/OrchardCore.Liquid/Services/SlugService.cs b/src/OrchardCore.Modules/OrchardCore.Liquid/Services/SlugService.cs deleted file mode 100644 index f7c9f211965..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Liquid/Services/SlugService.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Globalization; -using System.Text; -using Cysharp.Text; -using OrchardCore.Modules.Services; - -namespace OrchardCore.Liquid.Services -{ - [Obsolete("This class has been deprecated and will be removed in the next major release, please use OrchardCore.Modules.Services instead.", false)] - public class SlugService : ISlugService - { - private const char Hyphen = '-'; - private const int MaxLength = 1000; - - public string Slugify(string text, char separator) - { - throw new NotImplementedException(); - } - - public string Slugify(string text) - { - if (string.IsNullOrEmpty(text)) - { - return text; - } - - var appendHyphen = false; - var normalizedText = text.Normalize(NormalizationForm.FormKD); - - using var slug = ZString.CreateStringBuilder(); - - for (var i = 0; i < normalizedText.Length; i++) - { - var currentChar = char.ToLowerInvariant(normalizedText[i]); - - if (CharUnicodeInfo.GetUnicodeCategory(currentChar) == UnicodeCategory.NonSpacingMark) - { - continue; - } - - if (char.IsLetterOrDigit(currentChar)) - { - slug.Append(currentChar); - - appendHyphen = true; - } - else if (currentChar is Hyphen) - { - if (appendHyphen && i != normalizedText.Length - 1) - { - slug.Append(currentChar); - appendHyphen = false; - } - } - else if (currentChar == '_' || currentChar == '~') - { - slug.Append(currentChar); - } - else - { - if (appendHyphen) - { - slug.Append(Hyphen); - - appendHyphen = false; - } - } - } - - var length = Math.Min(slug.Length - GetTrailingHyphenCount(slug.AsSpan()), MaxLength); - - return new string(slug.AsSpan()[..length]).Normalize(NormalizationForm.FormC); - } - - private static int GetTrailingHyphenCount(ReadOnlySpan input) - { - var hyphenCount = 0; - for (var i = input.Length - 1; i >= 0; i--) - { - if (input[i] != Hyphen) - { - break; - } - - ++hyphenCount; - } - - return hyphenCount; - } - } -} diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/Drivers/ContentMenuItemPartDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Menu/Drivers/ContentMenuItemPartDisplayDriver.cs index df343140e0f..c243442e762 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/Drivers/ContentMenuItemPartDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Menu/Drivers/ContentMenuItemPartDisplayDriver.cs @@ -42,10 +42,6 @@ public override async Task UpdateAsync(ContentMenuItemPart part, await updater.TryUpdateModelAsync(model, Prefix); part.ContentItem.DisplayText = model.Name; - // This code can be removed in a later release. -#pragma warning disable 0618 - part.Name = model.Name; -#pragma warning restore 0618 return Edit(part); } diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/Drivers/LinkMenuItemPartDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Menu/Drivers/LinkMenuItemPartDisplayDriver.cs index a06b65985c3..7902719c617 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/Drivers/LinkMenuItemPartDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Menu/Drivers/LinkMenuItemPartDisplayDriver.cs @@ -72,11 +72,6 @@ public override async Task UpdateAsync(LinkMenuItemPart part, IU part.Url = model.Url; part.ContentItem.DisplayText = model.Name; - // This code can be removed in a later release. -#pragma warning disable 0618 - part.Name = model.Name; -#pragma warning restore 0618 - var urlToValidate = part.Url; if (!string.IsNullOrEmpty(urlToValidate)) diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/GraphQL/LinkMenuItemQueryObjectType.cs b/src/OrchardCore.Modules/OrchardCore.Menu/GraphQL/LinkMenuItemQueryObjectType.cs index 2529d9836ba..4c0d9746eae 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/GraphQL/LinkMenuItemQueryObjectType.cs +++ b/src/OrchardCore.Modules/OrchardCore.Menu/GraphQL/LinkMenuItemQueryObjectType.cs @@ -9,10 +9,6 @@ public LinkMenuItemQueryObjectType() { Name = "LinkMenuItemPart"; - // This code can be removed in a later release. -#pragma warning disable 0618 - Field(x => x.Name, nullable: true).Description("Deprecated. Use displayText."); -#pragma warning restore 0618 Field(x => x.Url, nullable: true); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/Migrations.cs b/src/OrchardCore.Modules/OrchardCore.Menu/Migrations.cs index e928e11e4af..f617a234491 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/Migrations.cs +++ b/src/OrchardCore.Modules/OrchardCore.Menu/Migrations.cs @@ -72,23 +72,6 @@ private static void MigrateMenuItems(List menuItems) { foreach (var menuItem in menuItems) { - var linkMenuItemPart = menuItem.As(); - if (linkMenuItemPart != null) - { - // This code can be removed in a later release. -#pragma warning disable 0618 - menuItem.DisplayText = linkMenuItemPart.Name; -#pragma warning restore 0618 - } - - var contentMenuItemPart = menuItem.As(); - if (contentMenuItemPart != null) - { -#pragma warning disable 0618 - menuItem.DisplayText = contentMenuItemPart.Name; -#pragma warning restore 0618 - } - var menuItemsListPart = menuItem.As(); if (menuItemsListPart != null) { diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/Models/ContentMenuItemPart.cs b/src/OrchardCore.Modules/OrchardCore.Menu/Models/ContentMenuItemPart.cs index 102ec98a938..7506cd9e372 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/Models/ContentMenuItemPart.cs +++ b/src/OrchardCore.Modules/OrchardCore.Menu/Models/ContentMenuItemPart.cs @@ -1,11 +1,8 @@ -using System; using OrchardCore.ContentManagement; namespace OrchardCore.Menu.Models { public class ContentMenuItemPart : ContentPart { - [Obsolete("This property is obsolete and will be removed in a future version. Use 'DisplayText'")] - public string Name { get; set; } } } diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/Models/LinkMenuItemPart.cs b/src/OrchardCore.Modules/OrchardCore.Menu/Models/LinkMenuItemPart.cs index f5325a0dbfb..90d042abf62 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/Models/LinkMenuItemPart.cs +++ b/src/OrchardCore.Modules/OrchardCore.Menu/Models/LinkMenuItemPart.cs @@ -1,13 +1,9 @@ -using System; using OrchardCore.ContentManagement; namespace OrchardCore.Menu.Models { public class LinkMenuItemPart : ContentPart { - [Obsolete("This property is obsolete and will be removed in a future version. Use 'DisplayText'")] - public string Name { get; set; } - /// /// The url of the link to create. /// diff --git a/src/OrchardCore.Modules/OrchardCore.Rules/Services/RuleMigrator.cs b/src/OrchardCore.Modules/OrchardCore.Rules/Services/RuleMigrator.cs deleted file mode 100644 index 6421884fb12..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Rules/Services/RuleMigrator.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using OrchardCore.Rules.Models; - -namespace OrchardCore.Rules.Services -{ - public class RuleMigrator : IRuleMigrator - { - private readonly IConditionIdGenerator _conditionIdGenerator; - private readonly IEnumerable _factories; - - public RuleMigrator(IConditionIdGenerator conditionIdGenerator, IEnumerable factories) - { - _conditionIdGenerator = conditionIdGenerator; - _factories = factories; - } - - public void Migrate(string existingRule, Rule rule) - { - var factories = _factories.ToDictionary(x => x.Name); - - // Migrates well-known rules to well-known conditions. - // A javascript condition is automatically created for less well-known rules. - switch (existingRule) - { - case "true": - if (factories.TryGetValue(nameof(BooleanCondition), out var booleanFactory)) - { - var condition = (BooleanCondition)booleanFactory.Create(); - _conditionIdGenerator.GenerateUniqueId(condition); - condition.Value = true; - rule.Conditions.Add(condition); - } - break; - case "isHomepage()": - if (factories.TryGetValue(nameof(HomepageCondition), out var homepageFactory)) - { - var condition = (HomepageCondition)homepageFactory.Create(); - _conditionIdGenerator.GenerateUniqueId(condition); - condition.Value = true; - rule.Conditions.Add(condition); - } - break; - case "isAnonymous()": - if (factories.TryGetValue(nameof(IsAnonymousCondition), out var isAnonymousFactory)) - { - var condition = (IsAnonymousCondition)isAnonymousFactory.Create(); - _conditionIdGenerator.GenerateUniqueId(condition); - rule.Conditions.Add(condition); - } - break; - case "isAuthenticated()": - if (factories.TryGetValue(nameof(IsAuthenticatedCondition), out var isAuthenticatedFactory)) - { - var condition = (IsAuthenticatedCondition)isAuthenticatedFactory.Create(); - _conditionIdGenerator.GenerateUniqueId(condition); - rule.Conditions.Add(condition); - } - break; - default: - if (factories.TryGetValue(nameof(JavascriptCondition), out var javascriptFactory)) - { - var condition = (JavascriptCondition)javascriptFactory.Create(); - _conditionIdGenerator.GenerateUniqueId(condition); - condition.Script = existingRule; - rule.Conditions.Add(condition); - } - break; - } - } - } -} diff --git a/src/OrchardCore.Modules/OrchardCore.Rules/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Rules/Startup.cs index 6fe2d6b7917..39ca1551c71 100644 --- a/src/OrchardCore.Modules/OrchardCore.Rules/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Rules/Startup.cs @@ -22,8 +22,7 @@ public override void ConfigureServices(IServiceCollection services) .AddTransient, ConditionOperatorConfigureOptions>() .AddScoped() .AddScoped() - .AddScoped() - .AddScoped(); + .AddScoped(); // All condition. services.AddRule(); diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/Razor/OrchardRazorHelperExtensions.cs b/src/OrchardCore.Modules/OrchardCore.Shortcodes/Razor/OrchardRazorHelperExtensions.cs index f351df3b082..147d5d2ec54 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/Razor/OrchardRazorHelperExtensions.cs +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/Razor/OrchardRazorHelperExtensions.cs @@ -1,4 +1,3 @@ -using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Html; using Microsoft.Extensions.DependencyInjection; @@ -38,8 +37,4 @@ public static async Task ShortcodesToHtmlAsync(this IOrchardHelper return new HtmlString(html); } - - [Obsolete("Replaced by ShortcodesToHtmlAsync")] - public static Task HtmlToShortcodesAsync(this IOrchardHelper orchardHelper, string html, object model = null) - => orchardHelper.ShortcodesToHtmlAsync(html, model); } diff --git a/src/OrchardCore.Modules/OrchardCore.Themes/Services/DarkModeService.cs b/src/OrchardCore.Modules/OrchardCore.Themes/Services/DarkModeService.cs deleted file mode 100644 index 67e9a05438b..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Themes/Services/DarkModeService.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Text.Json; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using OrchardCore.Admin.Models; -using OrchardCore.Environment.Shell; -using OrchardCore.Settings; - -namespace OrchardCore.Themes.Services -{ - [Obsolete("This class is obsolete and should no longer be used. Instead you may use ThemeTogglerService")] - public class DarkModeService - { - private readonly IHttpContextAccessor _httpContextAccessor; - private readonly ISiteService _siteService; - - public DarkModeService( - IHttpContextAccessor httpContextAccessor, - ISiteService siteService, - ShellSettings shellSettings) - { - _httpContextAccessor = httpContextAccessor; - _siteService = siteService; - CurrentTenant = shellSettings.Name; - } - - public string CurrentTenant { get; } - - public string CurrentTheme { get; set; } = "auto"; - - public async Task IsDarkModeAsync() - { - var result = false; - var adminSettings = (await _siteService.GetSiteSettingsAsync()).As(); - var cookieName = $"{CurrentTenant}-adminPreferences"; - - if (adminSettings.DisplayThemeToggler) - { - if (!string.IsNullOrWhiteSpace(_httpContextAccessor.HttpContext.Request.Cookies[cookieName])) - { - var adminPreferences = JsonDocument.Parse(_httpContextAccessor.HttpContext.Request.Cookies[cookieName]); - - if (adminPreferences.RootElement.TryGetProperty("darkMode", out var darkMode)) - { - result = darkMode.GetBoolean(); - } - } - } - - if (result) - { - CurrentTheme = "dark"; - } - - return result; - } - } -} diff --git a/src/OrchardCore.Modules/OrchardCore.Themes/Services/ISiteThemeService.cs b/src/OrchardCore.Modules/OrchardCore.Themes/Services/ISiteThemeService.cs index f4c5db0d1c6..f08f85b63da 100644 --- a/src/OrchardCore.Modules/OrchardCore.Themes/Services/ISiteThemeService.cs +++ b/src/OrchardCore.Modules/OrchardCore.Themes/Services/ISiteThemeService.cs @@ -1,4 +1,3 @@ -using System; using System.Threading.Tasks; using OrchardCore.Environment.Extensions; @@ -10,9 +9,6 @@ public interface ISiteThemeService Task SetSiteThemeAsync(string themeName); - [Obsolete("This method has been deprecated, please use GetSiteThemeNameAsync() instead.", error: false)] - async Task GetCurrentThemeNameAsync() => await GetSiteThemeNameAsync(); - Task GetSiteThemeNameAsync(); } } diff --git a/src/OrchardCore.Modules/OrchardCore.Themes/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Themes/Startup.cs index 10e388c7a46..4ade52a4454 100644 --- a/src/OrchardCore.Modules/OrchardCore.Themes/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Themes/Startup.cs @@ -28,9 +28,6 @@ public override void ConfigureServices(IServiceCollection services) services.AddScoped(); services.AddScoped(); services.AddScoped(); -#pragma warning disable CS0618 // Type or member is obsolete - services.AddScoped(); -#pragma warning restore CS0618 // Type or member is obsolete services.AddScoped(); services.AddDeployment(); services.AddScoped, ToggleThemeNavbarDisplayDriver>(); diff --git a/src/OrchardCore/OrchardCore.Abstractions/Json/Dynamic/JsonDynamicObject.cs b/src/OrchardCore/OrchardCore.Abstractions/Json/Dynamic/JsonDynamicObject.cs index 9e4ea95cfc5..2d3b5e5b182 100644 --- a/src/OrchardCore/OrchardCore.Abstractions/Json/Dynamic/JsonDynamicObject.cs +++ b/src/OrchardCore/OrchardCore.Abstractions/Json/Dynamic/JsonDynamicObject.cs @@ -89,9 +89,6 @@ public bool Remove(string key) public JsonNode? SelectNode(string path) => _jsonObject.SelectNode(path); - [Obsolete("Please use the SelectNode method", error: true)] - public JsonNode? SelectToken(string path) => _jsonObject.SelectNode(path); - public object? GetValue(string key) { if (_dictionary.TryGetValue(key, out var value)) diff --git a/src/OrchardCore/OrchardCore.Abstractions/Shell/Builders/IShellContainerFactory.cs b/src/OrchardCore/OrchardCore.Abstractions/Shell/Builders/IShellContainerFactory.cs index 763cb391457..f95a5fefc7c 100644 --- a/src/OrchardCore/OrchardCore.Abstractions/Shell/Builders/IShellContainerFactory.cs +++ b/src/OrchardCore/OrchardCore.Abstractions/Shell/Builders/IShellContainerFactory.cs @@ -8,11 +8,4 @@ public interface IShellContainerFactory { Task CreateContainerAsync(ShellSettings settings, ShellBlueprint blueprint); } - - public static class ShellContainerFactoryExtensions - { - [Obsolete("This method will be removed in a future version, use CreateContainerAsync instead.", false)] - public static IServiceProvider CreateContainer(this IShellContainerFactory factory, ShellSettings settings, ShellBlueprint blueprint) - => factory.CreateContainerAsync(settings, blueprint).GetAwaiter().GetResult(); - } } diff --git a/src/OrchardCore/OrchardCore.Abstractions/Shell/Builders/ShellContextExtensions.cs b/src/OrchardCore/OrchardCore.Abstractions/Shell/Builders/ShellContextExtensions.cs index 61e5c6561c9..e998affffd1 100644 --- a/src/OrchardCore/OrchardCore.Abstractions/Shell/Builders/ShellContextExtensions.cs +++ b/src/OrchardCore/OrchardCore.Abstractions/Shell/Builders/ShellContextExtensions.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -using OrchardCore.Environment.Shell.Scope; using OrchardCore.Locking; using OrchardCore.Locking.Distributed; @@ -60,26 +59,5 @@ public static class ShellContextExtensions return lockService.TryAcquireLockAsync("SHELL_REMOVING_LOCK", timeout, expiration); } - - /// - /// Creates a on this shell context. - /// - [Obsolete("This method will be removed in a future version, use CreateScopeAsync instead.", false)] - public static ShellScope CreateScope(this ShellContext shellContext) => - shellContext.CreateScopeAsync().GetAwaiter().GetResult(); - - /// - /// Mark the as released and then a candidate to be disposed. - /// - [Obsolete("This method will be removed in a future version, use ReleaseAsync instead.", false)] - public static void Release(this ShellContext shellContext) => - shellContext.ReleaseInternalAsync().GetAwaiter().GetResult(); - - /// - /// Registers the specified shellContext as dependent such that it is also released when the current shell context is released. - /// - [Obsolete("This method will be removed in a future version, use AddDependentShellAsync instead.", false)] - public static void AddDependentShell(this ShellContext shellContext) => - shellContext.AddDependentShellAsync(shellContext).GetAwaiter().GetResult(); } } diff --git a/src/OrchardCore/OrchardCore.Abstractions/Shell/Extensions/ShellStringExtensions.cs b/src/OrchardCore/OrchardCore.Abstractions/Shell/Extensions/ShellStringExtensions.cs index 95a2f2d95b5..80e527e633b 100644 --- a/src/OrchardCore/OrchardCore.Abstractions/Shell/Extensions/ShellStringExtensions.cs +++ b/src/OrchardCore/OrchardCore.Abstractions/Shell/Extensions/ShellStringExtensions.cs @@ -15,9 +15,3 @@ public static class ShellStringExtensions public static bool IsDefaultShellNameIgnoreCase(this string name) => name is not null && name.Equals(ShellSettings.DefaultShellName, StringComparison.OrdinalIgnoreCase); } - -[Obsolete("This class will be removed in a future release, use 'ShellSettings' instead.", false)] -public static class ShellHelper -{ - public const string DefaultShellName = ShellSettings.DefaultShellName; -} diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/ContentDefinitionManagerExtensions.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/ContentDefinitionManagerExtensions.cs index ebf23bc93c2..9165edd331b 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/ContentDefinitionManagerExtensions.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/ContentDefinitionManagerExtensions.cs @@ -10,15 +10,6 @@ namespace OrchardCore.ContentManagement.Metadata { public static class ContentDefinitionManagerExtensions { - [Obsolete($"Instead, utilize the {nameof(AlterTypeDefinitionAsync)} method. This current method is slated for removal in upcoming releases.")] - public static void AlterTypeDefinition(this IContentDefinitionManager manager, string name, Action alteration) - { - var typeDefinition = manager.LoadTypeDefinition(name) ?? new ContentTypeDefinition(name, name.CamelFriendly()); - var builder = new ContentTypeDefinitionBuilder(typeDefinition); - alteration(builder); - manager.StoreTypeDefinition(builder.Build()); - } - public static async Task AlterTypeDefinitionAsync(this IContentDefinitionManager manager, string name, Func alterationAsync) { var typeDefinition = (await manager.LoadTypeDefinitionAsync(name)) ?? new ContentTypeDefinition(name, name.CamelFriendly()); @@ -35,15 +26,6 @@ public static async Task AlterTypeDefinitionAsync(this IContentDefinitionManager await manager.StoreTypeDefinitionAsync(builder.Build()); } - [Obsolete($"Instead, utilize the {nameof(AlterTypeDefinitionAsync)} method. This current method is slated for removal in upcoming releases.")] - public static void AlterPartDefinition(this IContentDefinitionManager manager, string name, Action alteration) - { - var partDefinition = manager.LoadPartDefinition(name) ?? new ContentPartDefinition(name); - var builder = new ContentPartDefinitionBuilder(partDefinition); - alteration(builder); - manager.StorePartDefinition(builder.Build()); - } - public static async Task AlterPartDefinitionAsync(this IContentDefinitionManager manager, string name, Func alterationAsync) { var partDefinition = (await manager.LoadPartDefinitionAsync(name)) ?? new ContentPartDefinition(name); @@ -60,45 +42,6 @@ public static async Task AlterPartDefinitionAsync(this IContentDefinitionManager await manager.StorePartDefinitionAsync(builder.Build()); } - /// - /// Migrate existing ContentPart settings to WithSettings - /// This method will be removed in a future release. - /// - /// - /// - /// - [Obsolete($"Instead, utilize the {nameof(MigratePartSettingsAsync)} method. This current method is slated for removal in upcoming releases.")] - public static void MigratePartSettings(this IContentDefinitionManager manager) - where TPart : ContentPart where TSettings : class - { - var contentTypes = manager.LoadTypeDefinitions(); - - foreach (var contentType in contentTypes) - { - var partDefinition = contentType.Parts.FirstOrDefault(x => x.PartDefinition.Name == typeof(TPart).Name); - if (partDefinition != null) - { - var existingSettings = partDefinition.Settings.ToObject(); - - // Remove existing properties from JObject - var properties = typeof(TSettings).GetProperties(); - foreach (var property in properties) - { - partDefinition.Settings.Remove(property.Name); - } - - // Apply existing settings to type definition WithSettings - manager.AlterTypeDefinition(contentType.Name, typeBuilder => - { - typeBuilder.WithPart(partDefinition.Name, partBuilder => - { - partBuilder.WithSettings(existingSettings); - }); - }); - } - } - } - /// /// Migrate existing ContentPart settings to WithSettings /// This method will be removed in a future release. @@ -139,52 +82,6 @@ await manager.AlterTypeDefinitionAsync(contentType.Name, typeBuilder => } } - /// - /// Migrate existing ContentField settings to WithSettings - /// This method will be removed in a future release. - /// - /// - /// - /// - [Obsolete($"Instead, utilize the {nameof(MigrateFieldSettingsAsync)} method. This current method is slated for removal in upcoming releases.")] - public static void MigrateFieldSettings(this IContentDefinitionManager manager) - where TField : ContentField where TSettings : class - { - var partDefinitions = manager.LoadPartDefinitions(); - foreach (var partDefinition in partDefinitions) - { - manager.AlterPartDefinition(partDefinition.Name, partBuilder => - { - foreach (var fieldDefinition in partDefinition.Fields.Where(x => x.FieldDefinition.Name == typeof(TField).Name)) - { - var existingFieldSettings = fieldDefinition.Settings.ToObject(); - - // Do this before creating builder, so settings are removed from the builder settings object. - // Remove existing properties from JObject - var fieldSettingsProperties = existingFieldSettings.GetType().GetProperties(); - var hasSetting = false; - foreach (var property in fieldSettingsProperties) - { - if (fieldDefinition.Settings.ContainsKey(property.Name)) - { - hasSetting = true; - fieldDefinition.Settings.Remove(property.Name); - } - } - - // Only include settings if the definition already has at least one of these settings. - if (hasSetting) - { - partBuilder.WithField(fieldDefinition.Name, fieldBuilder => - { - fieldBuilder.WithSettings(existingFieldSettings); - }); - } - } - }); - } - } - /// /// Migrate existing ContentField settings to WithSettings /// This method will be removed in a future release. diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/IContentDefinitionManager.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/IContentDefinitionManager.cs index 1e42ca9873e..e3cf4dfae86 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/IContentDefinitionManager.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/IContentDefinitionManager.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Threading.Tasks; using OrchardCore.ContentManagement.Metadata.Models; @@ -40,52 +39,4 @@ public interface IContentDefinitionManager /// Returns an unique identifier that is updated when content definitions have changed. /// Task GetIdentifierAsync(); - - [Obsolete($"Instead, utilize the {nameof(LoadTypeDefinitionsAsync)} method. This current method is slated for removal in upcoming releases.")] - IEnumerable LoadTypeDefinitions() - => LoadTypeDefinitionsAsync().GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(ListTypeDefinitionsAsync)} method. This current method is slated for removal in upcoming releases.")] - IEnumerable ListTypeDefinitions() - => ListTypeDefinitionsAsync().GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(LoadPartDefinitionsAsync)} method. This current method is slated for removal in upcoming releases.")] - IEnumerable LoadPartDefinitions() - => LoadPartDefinitionsAsync().GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(ListPartDefinitionsAsync)} method. This current method is slated for removal in upcoming releases.")] - IEnumerable ListPartDefinitions() - => ListPartDefinitionsAsync().GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(LoadTypeDefinitionAsync)} method. This current method is slated for removal in upcoming releases.")] - ContentTypeDefinition LoadTypeDefinition(string name) - => LoadTypeDefinitionAsync(name).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(GetTypeDefinitionAsync)} method. This current method is slated for removal in upcoming releases.")] - ContentTypeDefinition GetTypeDefinition(string name) - => GetTypeDefinitionAsync(name).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(LoadPartDefinitionAsync)} method. This current method is slated for removal in upcoming releases.")] - ContentPartDefinition LoadPartDefinition(string name) - => LoadPartDefinitionAsync(name).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(GetPartDefinitionAsync)} method. This current method is slated for removal in upcoming releases.")] - ContentPartDefinition GetPartDefinition(string name) - => GetPartDefinitionAsync(name).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(DeleteTypeDefinitionAsync)} method. This current method is slated for removal in upcoming releases.")] - void DeleteTypeDefinition(string name) - => DeleteTypeDefinitionAsync(name).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(DeletePartDefinitionAsync)} method. This current method is slated for removal in upcoming releases.")] - void DeletePartDefinition(string name) - => DeletePartDefinitionAsync(name).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(StoreTypeDefinitionAsync)} method. This current method is slated for removal in upcoming releases.")] - void StoreTypeDefinition(ContentTypeDefinition contentTypeDefinition) - => StoreTypeDefinitionAsync(contentTypeDefinition).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(StorePartDefinitionAsync)} method. This current method is slated for removal in upcoming releases.")] - void StorePartDefinition(ContentPartDefinition contentPartDefinition) - => StorePartDefinitionAsync(contentPartDefinition).GetAwaiter().GetResult(); } diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentPartFieldDefinitionBuilder.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentPartFieldDefinitionBuilder.cs index 1d756e805bc..b1b9aad7b1b 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentPartFieldDefinitionBuilder.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentPartFieldDefinitionBuilder.cs @@ -20,20 +20,6 @@ protected ContentPartFieldDefinitionBuilder(ContentPartFieldDefinition field) _settings = field.Settings.Clone(); } - [Obsolete("Use WithSettings. This will be removed in a future version.")] - public ContentPartFieldDefinitionBuilder WithSetting(string name, string value) - { - _settings[name] = value; - return this; - } - - [Obsolete("Use WithSettings. This will be removed in a future version.")] - public ContentPartFieldDefinitionBuilder WithSetting(string name, string[] values) - { - _settings[name] = JArray.FromObject(values); - return this; - } - public ContentPartFieldDefinitionBuilder MergeSettings(JsonObject settings) { _settings.Merge(settings, ContentBuilderSettings.JsonMergeSettings); diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypeDefinitionBuilder.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypeDefinitionBuilder.cs index fed54244724..cc120828701 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypeDefinitionBuilder.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypeDefinitionBuilder.cs @@ -70,13 +70,6 @@ public ContentTypeDefinitionBuilder DisplayedAs(string displayName) return this; } - [Obsolete("Use WithSettings. This will be removed in a future version.")] - public ContentTypeDefinitionBuilder WithSetting(string name, object value) - { - _settings[name] = JNode.FromObject(value); - return this; - } - public ContentTypeDefinitionBuilder MergeSettings(JsonObject settings) { _settings.Merge(settings, ContentBuilderSettings.JsonMergeSettings); diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypePartDefinitionBuilder.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypePartDefinitionBuilder.cs index 94c201e2b98..08419716d8f 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypePartDefinitionBuilder.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypePartDefinitionBuilder.cs @@ -32,20 +32,6 @@ public ContentTypePartDefinitionBuilder WithSettings(T settings) return this; } - [Obsolete("Use WithSettings. This will be removed in a future version.")] - public ContentTypePartDefinitionBuilder WithSetting(string name, string value) - { - _settings[name] = value; - return this; - } - - [Obsolete("Use WithSettings. This will be removed in a future version.")] - public ContentTypePartDefinitionBuilder WithSetting(string name, string[] values) - { - _settings[name] = JArray.FromObject(values); - return this; - } - public ContentTypePartDefinitionBuilder MergeSettings(JsonObject settings) { _settings.Merge(settings, ContentBuilderSettings.JsonMergeSettings); diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Utilities/StringExtensions.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Utilities/StringExtensions.cs index 226534af914..78d5f453c7b 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Utilities/StringExtensions.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Utilities/StringExtensions.cs @@ -199,7 +199,7 @@ public static bool IsLetter(this char c) [Obsolete("Use Char.IsWhiteSpace() instead.")] public static bool IsSpace(this char c) { - return (c == '\r' || c == '\n' || c == '\t' || c == '\f' || c == ' '); + return c == '\r' || c == '\n' || c == '\t' || c == '\f' || c == ' '; } public static bool IsReservedContentName(this string name) => _reservedNames.Contains(name); diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/Descriptors/IShapeTableProvider.cs b/src/OrchardCore/OrchardCore.DisplayManagement/Descriptors/IShapeTableProvider.cs index 1b9bddd6f7c..6ba8d222273 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/Descriptors/IShapeTableProvider.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/Descriptors/IShapeTableProvider.cs @@ -1,19 +1,8 @@ -using System; using System.Threading.Tasks; namespace OrchardCore.DisplayManagement.Descriptors; public interface IShapeTableProvider { - [Obsolete($"Instead, utilize the {nameof(DiscoverAsync)} method. This current method is slated for removal in upcoming releases.")] - void Discover(ShapeTableBuilder builder); - - ValueTask DiscoverAsync(ShapeTableBuilder builder) - { -#pragma warning disable CS0618 // Type or member is obsolete - Discover(builder); -#pragma warning restore CS0618 // Type or member is obsolete - - return ValueTask.CompletedTask; - } + ValueTask DiscoverAsync(ShapeTableBuilder builder); } diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/Descriptors/ShapeTableProvider.cs b/src/OrchardCore/OrchardCore.DisplayManagement/Descriptors/ShapeTableProvider.cs index 057df85a480..5d760cd9143 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/Descriptors/ShapeTableProvider.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/Descriptors/ShapeTableProvider.cs @@ -1,14 +1,8 @@ -using System; using System.Threading.Tasks; namespace OrchardCore.DisplayManagement.Descriptors; public abstract class ShapeTableProvider : IShapeTableProvider { - [Obsolete($"Instead, utilize the {nameof(IShapeTableProvider.DiscoverAsync)} method. This current method is slated for removal in upcoming releases.")] - public void Discover(ShapeTableBuilder builder) - { - } - public abstract ValueTask DiscoverAsync(ShapeTableBuilder builder); } diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/Html/CssOrchardHelperExtensions.cs b/src/OrchardCore/OrchardCore.DisplayManagement/Html/CssOrchardHelperExtensions.cs index 40ff4098931..a68933e49a4 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/Html/CssOrchardHelperExtensions.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/Html/CssOrchardHelperExtensions.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Microsoft.AspNetCore.Html; @@ -58,53 +57,6 @@ public static IHtmlContent GetEndClasses(this IOrchardHelper helper, bool withOf public static IHtmlContent GetOffsetClasses(this IOrchardHelper helper, params string[] additionalClasses) => GetHtmlContentBuilder(helper.GetThemeOptions().OffsetClasses, additionalClasses); - [Obsolete($"Please use {nameof(GetLimitedWidthWrapperClasses)} instead, as this method is deprecated and will be removed in upcoming versions.")] - public static string GetLimitedWidthWrapperCssClasses(this IOrchardHelper helper, params string[] additionalClasses) - => string.Join(' ', Combine(helper.GetThemeOptions().LimitedWidthWrapperClasses, additionalClasses)); - - [Obsolete($"Please use {nameof(GetLimitedWidthClasses)} instead, as this method is deprecated and will be removed in upcoming versions.")] - public static string GetLimitedWidthCssClasses(this IOrchardHelper helper, params string[] additionalClasses) - => string.Join(' ', Combine(helper.GetThemeOptions().LimitedWidthClasses, additionalClasses)); - - [Obsolete($"Please use {nameof(GetLabelClasses)} instead, as this method is deprecated and will be removed in upcoming versions.")] - public static string GetLabelCssClasses(this IOrchardHelper helper, params string[] additionalClasses) - => string.Join(' ', Combine(helper.GetThemeOptions().LabelClasses, additionalClasses)); - - [Obsolete($"Please use {nameof(GetStartClasses)} instead, as this method is deprecated and will be removed in upcoming versions.")] - public static string GetStartCssClasses(this IOrchardHelper helper, params string[] additionalClasses) - => string.Join(' ', Combine(helper.GetThemeOptions().StartClasses, additionalClasses)); - - [Obsolete($"Please use {nameof(GetEndClasses)} instead, as this method is deprecated and will be removed in upcoming versions.")] - public static string GetEndCssClasses(this IOrchardHelper helper, params string[] additionalClasses) - => string.Join(' ', Combine(helper.GetThemeOptions().EndClasses, additionalClasses)); - - [Obsolete($"Please use {nameof(GetWrapperClasses)} instead, as this method is deprecated and will be removed in upcoming versions.")] - public static string GetWrapperCssClasses(this IOrchardHelper helper, params string[] additionalClasses) - => string.Join(' ', Combine(helper.GetThemeOptions().WrapperClasses, additionalClasses)); - - - [Obsolete($"Please use {nameof(GetEndClasses)} instead, as this method is deprecated and will be removed in upcoming versions.")] - public static string GetEndCssClasses(this IOrchardHelper helper, bool withOffset, params string[] additionalClasses) - { - var options = helper.GetThemeOptions(); - - if (withOffset && !string.IsNullOrEmpty(options.OffsetClasses)) - { - var cssClasses = new List(additionalClasses) - { - options.OffsetClasses - }; - - return string.Join(' ', Combine(options.EndClasses, cssClasses.ToArray())); - } - - return string.Join(' ', Combine(options.EndClasses, additionalClasses.ToArray())); - } - - [Obsolete($"Please use {nameof(GetOffsetClasses)} instead, as this method is deprecated and will be removed in upcoming versions.")] - public static string GetOffsetCssClasses(this IOrchardHelper helper, params string[] additionalClasses) - => string.Join(' ', Combine(helper.GetThemeOptions().OffsetClasses, additionalClasses)); - public static TheAdminThemeOptions GetThemeOptions(this IOrchardHelper helper) => helper.HttpContext.RequestServices.GetService>().Value; @@ -115,7 +67,7 @@ private static IEnumerable Combine(string optionClasses, string[] additi return additionalClasses; } - return additionalClasses.Concat(new[] { optionClasses }); + return additionalClasses.Concat([optionClasses]); } private static HtmlContentBuilder GetHtmlContentBuilder(string optionClasses, IList values) diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/IDisplayManager.cs b/src/OrchardCore/OrchardCore.DisplayManagement/IDisplayManager.cs index 0358436891d..c78a415ac25 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/IDisplayManager.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/IDisplayManager.cs @@ -1,4 +1,3 @@ -using System; using System.Threading.Tasks; using OrchardCore.DisplayManagement.ModelBinding; @@ -7,15 +6,9 @@ namespace OrchardCore.DisplayManagement public interface IDisplayManager { Task BuildDisplayAsync(TModel model, IUpdateModel updater, string displayType = "", string groupId = ""); - Task BuildEditorAsync(TModel model, IUpdateModel updater, bool isNew, string groupId, string htmlPrefix); - Task UpdateEditorAsync(TModel model, IUpdateModel updater, bool isNew, string groupId, string htmlPrefix); - [Obsolete("This method will be removed in a future version", false)] - Task BuildEditorAsync(TModel model, IUpdateModel updater, bool isNew, string groupId = "") - => BuildEditorAsync(model, updater, isNew, groupId, ""); + Task BuildEditorAsync(TModel model, IUpdateModel updater, bool isNew, string groupId = "", string htmlPrefix = ""); - [Obsolete("This method will be removed in a future version", false)] - Task UpdateEditorAsync(TModel model, IUpdateModel updater, bool isNew, string groupId = "") - => UpdateEditorAsync(model, updater, isNew, groupId, ""); + Task UpdateEditorAsync(TModel model, IUpdateModel updater, bool isNew, string groupId = "", string htmlPrefix = ""); } } diff --git a/src/OrchardCore/OrchardCore.Email.Abstractions/MailMessage.cs b/src/OrchardCore/OrchardCore.Email.Abstractions/MailMessage.cs index de08e2a5514..5bd26dc8f22 100644 --- a/src/OrchardCore/OrchardCore.Email.Abstractions/MailMessage.cs +++ b/src/OrchardCore/OrchardCore.Email.Abstractions/MailMessage.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; namespace OrchardCore.Email @@ -52,40 +51,6 @@ public class MailMessage /// This property is work in conjunction with to determine the body type.. public string Body { get; set; } - /// - /// Gets or sets the message content as plain text. - /// - [Obsolete("This property is deprecated, please use Body instead.")] - public string BodyText - { - get => Body; - set - { - Body = value; - IsHtmlBody = false; - } - } - - /// - /// Gets or sets whether the message body is an HTML. - /// - [Obsolete("This property is deprecated, please use IsHtmlBody instead.")] - public bool IsBodyHtml - { - get => IsHtmlBody; - set => IsHtmlBody = value; - } - - /// - /// Gets or sets whether the message body is plain text. - /// - [Obsolete("This property is deprecated, please use IsHtmlBody instead.")] - public bool IsBodyText - { - get => !IsHtmlBody; - set => IsHtmlBody = !value; - } - /// /// Gets or sets whether the message body is an HTML or not. Default is false which is plain text. /// diff --git a/src/OrchardCore/OrchardCore.Indexing.Abstractions/ContentIndexSettings.cs b/src/OrchardCore/OrchardCore.Indexing.Abstractions/ContentIndexSettings.cs deleted file mode 100644 index f39df0f9fcf..00000000000 --- a/src/OrchardCore/OrchardCore.Indexing.Abstractions/ContentIndexSettings.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; - -namespace OrchardCore.Indexing -{ - /// - /// Represents the indexing settings for a content part or a field. - /// - [Obsolete("This class has been deprecated and we will be removed in the next major release, please use IContentIndexSettings instead.", false)] - public class ContentIndexSettings - { - /// - /// Set the content to be added in the index document. Will be indexed based on CLR Type. - /// - public bool Included { get; set; } - - /// - /// Set the content to be indexed in the index as a keyword (tokenized as a single term). - /// See Lucene StringField. - /// - public bool Keyword { get; set; } - - /// - /// Set the content to be stored in the index document. The original value will be stored. - /// - public bool Stored { get; set; } - - public DocumentIndexOptions ToOptions() - { - var options = DocumentIndexOptions.None; - - if (Stored) - { - options |= DocumentIndexOptions.Store; - } - - if (Keyword) - { - options |= DocumentIndexOptions.Keyword; - } - - return options; - } - } -} - diff --git a/src/OrchardCore/OrchardCore.Logging.Serilog/ApplicationBuilderExtensions.cs b/src/OrchardCore/OrchardCore.Logging.Serilog/ApplicationBuilderExtensions.cs index 9e932dc2972..f4cdd464c65 100644 --- a/src/OrchardCore/OrchardCore.Logging.Serilog/ApplicationBuilderExtensions.cs +++ b/src/OrchardCore/OrchardCore.Logging.Serilog/ApplicationBuilderExtensions.cs @@ -1,16 +1,9 @@ -using System; using Microsoft.AspNetCore.Builder; namespace OrchardCore.Logging { public static class ApplicationBuilderExtensions { - [Obsolete("This method will be removed in a future version.", false)] - public static IApplicationBuilder UseSerilogTenantNameLoggingMiddleware(this IApplicationBuilder builder) - { - return builder.UseMiddleware(); - } - public static IApplicationBuilder UseSerilogTenantNameLogging(this IApplicationBuilder builder) { return builder.UseMiddleware(); diff --git a/src/OrchardCore/OrchardCore.Queries.Abstractions/LuceneQueryResults.cs b/src/OrchardCore/OrchardCore.Queries.Abstractions/LuceneQueryResults.cs deleted file mode 100644 index 3a9e65fef0a..00000000000 --- a/src/OrchardCore/OrchardCore.Queries.Abstractions/LuceneQueryResults.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace OrchardCore.Queries -{ - [Obsolete("This class has been deprecated and will be removed in the next major release, please use OrchardCore.Search.Lucene.Abstractions instead.", false)] - public class LuceneQueryResults : IQueryResults - { - public IEnumerable Items { get; set; } - public int Count { get; set; } - } -} diff --git a/src/OrchardCore/OrchardCore.Recipes.Abstractions/Services/IRecipeReader.cs b/src/OrchardCore/OrchardCore.Recipes.Abstractions/Services/IRecipeReader.cs index 1d2b462b467..2e0517ea87a 100644 --- a/src/OrchardCore/OrchardCore.Recipes.Abstractions/Services/IRecipeReader.cs +++ b/src/OrchardCore/OrchardCore.Recipes.Abstractions/Services/IRecipeReader.cs @@ -1,4 +1,3 @@ -using System; using System.Threading.Tasks; using Microsoft.Extensions.FileProviders; using OrchardCore.Recipes.Models; @@ -7,10 +6,6 @@ namespace OrchardCore.Recipes.Services { public interface IRecipeReader { - [Obsolete("This method has been deprecated, please use GetRecipeDescriptorAsync(string, IFileInfo, IFileProvider).")] - Task GetRecipeDescriptor(string recipeBasePath, IFileInfo recipeFileInfo, IFileProvider fileProvider) - => GetRecipeDescriptorAsync(recipeBasePath, recipeFileInfo, fileProvider); - Task GetRecipeDescriptorAsync(string recipeBasePath, IFileInfo recipeFileInfo, IFileProvider fileProvider); } } diff --git a/src/OrchardCore/OrchardCore.Rules.Abstractions/Services/IRuleMigrator.cs b/src/OrchardCore/OrchardCore.Rules.Abstractions/Services/IRuleMigrator.cs deleted file mode 100644 index 8f67062ede9..00000000000 --- a/src/OrchardCore/OrchardCore.Rules.Abstractions/Services/IRuleMigrator.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace OrchardCore.Rules.Services -{ - /// - /// Migrates existing script rules to rules. - /// - /// - /// For migrations purposes only. This code can be removed in a later release. - /// - public interface IRuleMigrator - { - void Migrate(string existingRule, Rule rule); - } -} diff --git a/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Models/ElasticSettings.cs b/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Models/ElasticSettings.cs index 7fce5c796a0..d0c718d9ff0 100644 --- a/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Models/ElasticSettings.cs +++ b/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Models/ElasticSettings.cs @@ -1,4 +1,3 @@ -using System; using OrchardCore.Contents.Indexing; namespace OrchardCore.Search.Elasticsearch.Core.Models; @@ -19,20 +18,12 @@ public class ElasticSettings public string SearchType { get; set; } - [Obsolete("This property will be removed in future releases.")] - public const string StandardAnalyzer = "standardanalyzer"; - - [Obsolete($"This property will be removed in future releases. Instead use {nameof(SearchType)} property.")] - public bool AllowElasticQueryStringQueryInSearch { get; set; } = false; - public string GetSearchType() { -#pragma warning disable CS0618 // Type or member is obsolete - if (SearchType == null && AllowElasticQueryStringQueryInSearch) + if (SearchType == null) { return QueryStringSearchType; } -#pragma warning restore CS0618 // Type or member is obsolete return SearchType; } diff --git a/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexManager.cs b/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexManager.cs index bad44538703..2e14b5d0dc9 100644 --- a/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexManager.cs +++ b/src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexManager.cs @@ -123,7 +123,7 @@ public async Task CreateIndexAsync(ElasticIndexSettings elasticIndexSettin .Map(m => m .SourceField(s => s .Enabled(elasticIndexSettings.StoreSourceData) - .Excludes(new string[] { IndexingConstants.DisplayTextAnalyzedKey })) + .Excludes([IndexingConstants.DisplayTextAnalyzedKey])) .Meta(me => IndexingState)); var response = await _elasticClient.Indices.CreateAsync(createIndexDescriptor); diff --git a/src/OrchardCore/OrchardCore.Setup.Abstractions/Events/ISetupEventHandler.cs b/src/OrchardCore/OrchardCore.Setup.Abstractions/Events/ISetupEventHandler.cs index b21be595e99..9b30545ea85 100644 --- a/src/OrchardCore/OrchardCore.Setup.Abstractions/Events/ISetupEventHandler.cs +++ b/src/OrchardCore/OrchardCore.Setup.Abstractions/Events/ISetupEventHandler.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using System.Threading.Tasks; using OrchardCore.Setup.Services; @@ -7,17 +5,12 @@ namespace OrchardCore.Setup.Events; public interface ISetupEventHandler { - [Obsolete($"This method is obsolete and will be removed in future releases. Please use '{nameof(SetupAsync)}' instead.", false)] - Task Setup(IDictionary properties, Action reportError) => Task.CompletedTask; - /// /// Called during the process of setting up a new tenant. /// /// /// -#pragma warning disable CS0618 // Type or member is obsolete - Task SetupAsync(SetupContext context) => Setup(context.Properties, (key, message) => context.Errors[key] = message); -#pragma warning restore CS0618 // Type or member is obsolete + Task SetupAsync(SetupContext context) => Task.CompletedTask; /// /// Called when a tenant fails to setup. diff --git a/src/OrchardCore/OrchardCore.Sitemaps.Abstractions/Services/IRouteableContentTypeCoordinator.cs b/src/OrchardCore/OrchardCore.Sitemaps.Abstractions/Services/IRouteableContentTypeCoordinator.cs index 97f78bf245e..dd37ba4a9d3 100644 --- a/src/OrchardCore/OrchardCore.Sitemaps.Abstractions/Services/IRouteableContentTypeCoordinator.cs +++ b/src/OrchardCore/OrchardCore.Sitemaps.Abstractions/Services/IRouteableContentTypeCoordinator.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Threading.Tasks; using OrchardCore.ContentManagement; @@ -21,11 +20,4 @@ public interface IRouteableContentTypeCoordinator /// Gets the route for a content item, when building a sitemap. /// Task GetRouteAsync(SitemapBuilderContext context, ContentItem contentItem); - - /// - /// Lists all routable content types. - /// - [Obsolete($"Instead, utilize the {nameof(ListRoutableTypeDefinitionsAsync)} method. This current method is slated for removal in upcoming releases.")] - IEnumerable ListRoutableTypeDefinitions() - => ListRoutableTypeDefinitionsAsync().GetAwaiter().GetResult(); } diff --git a/src/OrchardCore/OrchardCore.Sitemaps.Abstractions/Services/IRouteableContentTypeProvider.cs b/src/OrchardCore/OrchardCore.Sitemaps.Abstractions/Services/IRouteableContentTypeProvider.cs index 1865de01911..f5914778c37 100644 --- a/src/OrchardCore/OrchardCore.Sitemaps.Abstractions/Services/IRouteableContentTypeProvider.cs +++ b/src/OrchardCore/OrchardCore.Sitemaps.Abstractions/Services/IRouteableContentTypeProvider.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Threading.Tasks; using OrchardCore.ContentManagement; @@ -21,11 +20,4 @@ public interface IRouteableContentTypeProvider /// Gets the route for a content item, when building a sitemap. /// Task GetRouteAsync(SitemapBuilderContext context, ContentItem contentItem); - - /// - /// Provides routable content types. - /// - [Obsolete($"Instead, utilize the {nameof(ListRoutableTypeDefinitionsAsync)} method. This current method is slated for removal in upcoming releases.")] - IEnumerable ListRoutableTypeDefinitions() - => ListRoutableTypeDefinitionsAsync().GetAwaiter().GetResult(); } diff --git a/src/OrchardCore/OrchardCore.Users.Core/Services/CustomUserSettingsService.cs b/src/OrchardCore/OrchardCore.Users.Core/Services/CustomUserSettingsService.cs index 029e8db97de..c2e1858a9aa 100644 --- a/src/OrchardCore/OrchardCore.Users.Core/Services/CustomUserSettingsService.cs +++ b/src/OrchardCore/OrchardCore.Users.Core/Services/CustomUserSettingsService.cs @@ -29,22 +29,6 @@ public CustomUserSettingsService( _session = session; } - [Obsolete($"Instead, utilize the {nameof(GetAllSettingsTypeNamesAsync)} method. This current method is slated for removal in upcoming releases.")] - public IEnumerable GetAllSettingsTypeNames() - => _settingsTypes.Value.GetAwaiter().GetResult().Keys; - - [Obsolete($"Instead, utilize the {nameof(GetAllSettingsTypesAsync)} method. This current method is slated for removal in upcoming releases.")] - public IEnumerable GetAllSettingsTypes() - => _settingsTypes.Value.GetAwaiter().GetResult().Values; - - [Obsolete($"Instead, utilize the {nameof(GetSettingsTypesAsync)} method. This current method is slated for removal in upcoming releases.")] - public IEnumerable GetSettingsTypes(params string[] settingsTypeNames) - => GetSettingsTypesAsync(settingsTypeNames).GetAwaiter().GetResult(); - - [Obsolete($"Instead, utilize the {nameof(GetSettingsTypeAsync)} method. This current method is slated for removal in upcoming releases.")] - public ContentTypeDefinition GetSettingsType(string settingsTypeName) - => GetSettingsTypeAsync(settingsTypeName).GetAwaiter().GetResult(); - public async Task> GetAllSettingsTypeNamesAsync() => (await _settingsTypes.Value).Keys; diff --git a/src/OrchardCore/OrchardCore.Users.Core/Services/DefaultUserClaimsPrincipalFactory.cs b/src/OrchardCore/OrchardCore.Users.Core/Services/DefaultUserClaimsPrincipalFactory.cs deleted file mode 100644 index bcd6de5e845..00000000000 --- a/src/OrchardCore/OrchardCore.Users.Core/Services/DefaultUserClaimsPrincipalFactory.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Options; -using OrchardCore.Security; - -namespace OrchardCore.Users.Services -{ - /// - /// Custom implementation of adding email claims. - /// - [Obsolete("The class 'DefaultUserClaimsPrincipalFactory' is obsolete, please implement 'IUserClaimsProvider' instead.")] - public class DefaultUserClaimsPrincipalFactory : UserClaimsPrincipalFactory - { - public DefaultUserClaimsPrincipalFactory( - UserManager userManager, - RoleManager roleManager, - IOptions identityOptions) : base(userManager, roleManager, identityOptions) - { - } - - protected override async Task GenerateClaimsAsync(IUser user) - { - var claims = await base.GenerateClaimsAsync(user); - - // Todo: In a future version the base implementation will generate the email claim if the user store is an 'IUserEmailStore', - // so we will not have to add it here, and everywhere we are using the hardcoded "email" claim type, we will have to use the - // new 'IdentityOptions.ClaimsIdentity.EmailClaimType' or at least its default value which is 'ClaimTypes.Email'. - - var email = await UserManager.GetEmailAsync(user); - if (!string.IsNullOrEmpty(email)) - { - claims.AddClaim(new Claim("email", email)); - - var confirmed = await UserManager.IsEmailConfirmedAsync(user); - claims.AddClaim(new Claim("email_verified", confirmed ? bool.TrueString : bool.FalseString, ClaimValueTypes.Boolean)); - } - - return claims; - } - } -} diff --git a/src/OrchardCore/OrchardCore.Workflows.Abstractions/Services/IWorkflowStore.cs b/src/OrchardCore/OrchardCore.Workflows.Abstractions/Services/IWorkflowStore.cs index 0e372b15380..60548c03831 100644 --- a/src/OrchardCore/OrchardCore.Workflows.Abstractions/Services/IWorkflowStore.cs +++ b/src/OrchardCore/OrchardCore.Workflows.Abstractions/Services/IWorkflowStore.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using OrchardCore.Workflows.Models; @@ -22,11 +20,4 @@ public interface IWorkflowStore Task SaveAsync(Workflow workflow); Task DeleteAsync(Workflow workflow); } - - public static class WorkflowStoreExtensions - { - [Obsolete("This method will be removed in a future version, use the method accepting a collection of long ids.", false)] - public static Task> GetAsync(this IWorkflowStore store, IEnumerable ids) => - store.GetAsync(ids.Select(id => Convert.ToInt64(id))); - } } diff --git a/src/OrchardCore/OrchardCore.Workflows.Abstractions/Services/IWorkflowTypeStore.cs b/src/OrchardCore/OrchardCore.Workflows.Abstractions/Services/IWorkflowTypeStore.cs index 55482deda17..222dfdecc67 100644 --- a/src/OrchardCore/OrchardCore.Workflows.Abstractions/Services/IWorkflowTypeStore.cs +++ b/src/OrchardCore/OrchardCore.Workflows.Abstractions/Services/IWorkflowTypeStore.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using OrchardCore.Workflows.Models; @@ -16,11 +14,4 @@ public interface IWorkflowTypeStore Task SaveAsync(WorkflowType workflowType); Task DeleteAsync(WorkflowType workflowType); } - - public static class WorkflowTypeStoreExtensions - { - [Obsolete("This method will be removed in a future version, use the method accepting a collection of long ids.", false)] - public static Task> GetAsync(this IWorkflowTypeStore store, IEnumerable ids) => - store.GetAsync(ids.Select(id => Convert.ToInt64(id))); - } } diff --git a/test/OrchardCore.Tests/DisplayManagement/Decriptors/DefaultShapeTableManagerTests.cs b/test/OrchardCore.Tests/DisplayManagement/Decriptors/DefaultShapeTableManagerTests.cs index 391cb7cf62c..86181a83a04 100644 --- a/test/OrchardCore.Tests/DisplayManagement/Decriptors/DefaultShapeTableManagerTests.cs +++ b/test/OrchardCore.Tests/DisplayManagement/Decriptors/DefaultShapeTableManagerTests.cs @@ -289,7 +289,7 @@ public class TestShapeProvider : IShapeTableProvider public static void InitFeatureShapes(IDictionary> featureShapes) => _featureShapes = featureShapes; - void IShapeTableProvider.Discover(ShapeTableBuilder builder) + ValueTask IShapeTableProvider.DiscoverAsync(ShapeTableBuilder builder) { foreach (var pair in FeatureShapes) { @@ -300,6 +300,8 @@ void IShapeTableProvider.Discover(ShapeTableBuilder builder) } Discover(builder); + + return ValueTask.CompletedTask; } }