Adds tag support for any IContentBase and to the MediaRepository, adds test to ensure tags relations are removed.

This commit is contained in:
Shannon
2013-10-08 12:25:03 +11:00
parent 38a5b49ea3
commit 0b8b413f2f
7 changed files with 97 additions and 7 deletions

View File

@@ -537,7 +537,7 @@ namespace Umbraco.Core.Models
/// <param name="replaceTags">True to replace the tags on the current property with the tags specified or false to merge them with the currently assigned ones</param>
/// <param name="tagGroup">The group/category to assign the tags, the default value is "default"</param>
/// <returns></returns>
public static void SetTags(this IContent content, string propertyTypeAlias, IEnumerable<string> tags, bool replaceTags, string tagGroup = "default")
public static void SetTags(this IContentBase content, string propertyTypeAlias, IEnumerable<string> tags, bool replaceTags, string tagGroup = "default")
{
var property = content.Properties[propertyTypeAlias];
if (property == null)
@@ -572,7 +572,7 @@ namespace Umbraco.Core.Models
/// <param name="propertyTypeAlias"></param>
/// <param name="tags"></param>
/// <param name="tagGroup">The group/category that the tags are currently assigned to, the default value is "default"</param>
public static void RemoveTags(this IContent content, string propertyTypeAlias, IEnumerable<string> tags, string tagGroup = "default")
public static void RemoveTags(this IContentBase content, string propertyTypeAlias, IEnumerable<string> tags, string tagGroup = "default")
{
var property = content.Properties[propertyTypeAlias];
if (property == null)