From 9df8f0527385494c29ffd13abe5d940ef627deea Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Fri, 26 Jul 2024 16:17:49 -0700 Subject: [PATCH] Add RemovePart extension (#16491) --- .../Metadata/Builders/ContentTypeDefinitionBuilder.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypeDefinitionBuilder.cs b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypeDefinitionBuilder.cs index cc120828701..bb76ac8cda7 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypeDefinitionBuilder.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypeDefinitionBuilder.cs @@ -102,6 +102,10 @@ public ContentTypeDefinitionBuilder WithSettings(T settings) return this; } + public ContentTypeDefinitionBuilder RemovePart() + where TPart : ContentPart + => RemovePart(typeof(TPart).Name); + public ContentTypeDefinitionBuilder RemovePart(string partName) { var existingPart = _parts.SingleOrDefault(x => string.Equals(x.Name, partName, StringComparison.OrdinalIgnoreCase));