Interface ITagRepository
Namespace: Umbraco.Cms.Core.Persistence.Repositories
Assembly: Umbraco.Core.dll
Syntax
public interface ITagRepository : IReadWriteQueryRepository<int, ITag>, IReadRepository<int, ITag>, IWriteRepository<ITag>, IQueryRepository<ITag>, IRepository
Methods
View SourceAssign(Int32, Int32, IEnumerable<ITag>, Boolean)
Assign tags to a content property.
Declaration
void Assign(int contentId, int propertyTypeId, IEnumerable<ITag> tags, bool replaceTags = true)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | The identifier of the content item. |
System.Int32 | propertyTypeId | The identifier of the property type. |
IEnumerable<ITag> | tags | The tags to assign. |
System.Boolean | replaceTags | A value indicating whether to replace already assigned tags. |
Remarks
When replaceTags
is false, the tags specified in tags
are added to
those already assigned.
When tags
is empty and replaceTags
is true, all assigned tags are
removed.
GetTaggedEntitiesByTag(TaggableObjectTypes, String, String, String)
Gets all entities of a type, tagged with the specified tag.
Declaration
IEnumerable<TaggedEntity> GetTaggedEntitiesByTag(TaggableObjectTypes objectType, string tag, string group = null, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
TaggableObjectTypes | objectType | |
System.String | tag | |
System.String | group | |
System.String | culture |
Returns
Type | Description |
---|---|
IEnumerable<TaggedEntity> |
GetTaggedEntitiesByTagGroup(TaggableObjectTypes, String, String)
Declaration
IEnumerable<TaggedEntity> GetTaggedEntitiesByTagGroup(TaggableObjectTypes objectType, string group, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
TaggableObjectTypes | objectType | |
System.String | group | |
System.String | culture |
Returns
Type | Description |
---|---|
IEnumerable<TaggedEntity> |
GetTaggedEntityById(Int32)
Gets a tagged entity.
Declaration
TaggedEntity GetTaggedEntityById(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id |
Returns
Type | Description |
---|---|
TaggedEntity |
GetTaggedEntityByKey(Guid)
Gets a tagged entity.
Declaration
TaggedEntity GetTaggedEntityByKey(Guid key)
Parameters
Type | Name | Description |
---|---|---|
Guid | key |
Returns
Type | Description |
---|---|
TaggedEntity |
GetTagsForEntity(Guid, String, String)
Gets all tags attached to an entity.
Declaration
IEnumerable<ITag> GetTagsForEntity(Guid contentId, string group = null, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
Guid | contentId | |
System.String | group | |
System.String | culture |
Returns
Type | Description |
---|---|
IEnumerable<ITag> |
GetTagsForEntity(Int32, String, String)
Gets all tags attached to an entity.
Declaration
IEnumerable<ITag> GetTagsForEntity(int contentId, string group = null, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | |
System.String | group | |
System.String | culture |
Returns
Type | Description |
---|---|
IEnumerable<ITag> |
GetTagsForEntityType(TaggableObjectTypes, String, String)
Gets all tags for an entity type.
Declaration
IEnumerable<ITag> GetTagsForEntityType(TaggableObjectTypes objectType, string group = null, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
TaggableObjectTypes | objectType | |
System.String | group | |
System.String | culture |
Returns
Type | Description |
---|---|
IEnumerable<ITag> |
GetTagsForProperty(Guid, String, String, String)
Gets all tags attached to an entity via a property.
Declaration
IEnumerable<ITag> GetTagsForProperty(Guid contentId, string propertyTypeAlias, string group = null, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
Guid | contentId | |
System.String | propertyTypeAlias | |
System.String | group | |
System.String | culture |
Returns
Type | Description |
---|---|
IEnumerable<ITag> |
GetTagsForProperty(Int32, String, String, String)
Gets all tags attached to an entity via a property.
Declaration
IEnumerable<ITag> GetTagsForProperty(int contentId, string propertyTypeAlias, string group = null, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | |
System.String | propertyTypeAlias | |
System.String | group | |
System.String | culture |
Returns
Type | Description |
---|---|
IEnumerable<ITag> |
Remove(Int32, Int32, IEnumerable<ITag>)
Removes assigned tags from a content property.
Declaration
void Remove(int contentId, int propertyTypeId, IEnumerable<ITag> tags)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | The identifier of the content item. |
System.Int32 | propertyTypeId | The identifier of the property type. |
IEnumerable<ITag> | tags | The tags to remove. |
RemoveAll(Int32)
Removes all assigned tags from a content item.
Declaration
void RemoveAll(int contentId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | The identifier of the content item. |
RemoveAll(Int32, Int32)
Removes all assigned tags from a content property.
Declaration
void RemoveAll(int contentId, int propertyTypeId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | The identifier of the content item. |
System.Int32 | propertyTypeId | The identifier of the property type. |