Skip to content

Commit

Permalink
Add RemovePart<TPart> extension (OrchardCMS#16491)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek authored and hyzx86 committed Jul 30, 2024
1 parent de11ba8 commit 9df8f05
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ public ContentTypeDefinitionBuilder WithSettings<T>(T settings)
return this;
}

public ContentTypeDefinitionBuilder RemovePart<TPart>()
where TPart : ContentPart
=> RemovePart(typeof(TPart).Name);

public ContentTypeDefinitionBuilder RemovePart(string partName)
{
var existingPart = _parts.SingleOrDefault(x => string.Equals(x.Name, partName, StringComparison.OrdinalIgnoreCase));
Expand Down

0 comments on commit 9df8f05

Please sign in to comment.