Class ContentTagsExtensions
Provides extension methods for the IContentBase class, to manage tags.
Inheritance
object
Namespace: Umbraco.Extensions
Assembly: Umbraco.Core.dll
Syntax
public static class ContentTagsExtensions
Methods
View SourceAssignTags(IContentBase, PropertyEditorCollection, IDataTypeService, IJsonSerializer, string, IEnumerable<string>, bool, string?)
Assign tags.
Declaration
public static void AssignTags(this IContentBase content, PropertyEditorCollection propertyEditors, IDataTypeService dataTypeService, IJsonSerializer serializer, string propertyTypeAlias, IEnumerable<string> tags, bool merge = false, string? culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IContentBase | content | The content item. |
| PropertyEditorCollection | propertyEditors | |
| IDataTypeService | dataTypeService | |
| IJsonSerializer | serializer | |
| string | propertyTypeAlias | The property alias. |
| IEnumerable<string> | tags | The tags. |
| bool | merge | A value indicating whether to merge the tags with existing tags instead of replacing them. |
| string | culture | A culture, for multi-lingual properties. |
RemoveTags(IContentBase, PropertyEditorCollection, IDataTypeService, IJsonSerializer, string, IEnumerable<string>, string?)
Remove tags.
Declaration
public static void RemoveTags(this IContentBase content, PropertyEditorCollection propertyEditors, IDataTypeService dataTypeService, IJsonSerializer serializer, string propertyTypeAlias, IEnumerable<string> tags, string? culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IContentBase | content | The content item. |
| PropertyEditorCollection | propertyEditors | |
| IDataTypeService | dataTypeService | |
| IJsonSerializer | serializer | |
| string | propertyTypeAlias | The property alias. |
| IEnumerable<string> | tags | The tags. |
| string | culture | A culture, for multi-lingual properties. |