Merge branch 'temp8-fixes-published-content-children-method' into dev-v8

(cherry picked from commit 735d759208)
This commit is contained in:
Stephan
2019-02-20 12:56:14 +01:00
committed by Sebastiaan Janssen
parent a61a2b4d97
commit d9d54f7982

View File

@@ -979,11 +979,11 @@ namespace Umbraco.Web
/// </summary>
/// <param name="content">The content.</param>
/// <param name="culture">The specific culture to filter for. If null is used the current culture is used. (Default is null)</param>
/// <param name="alias">One or more content type alias.</param>
/// <param name="contentTypeAlias">The content type alias.</param>
/// <returns>The children of the content, of any of the specified types.</returns>
public static IEnumerable<IPublishedContent> Children(this IPublishedContent content, string culture = null, params string[] alias)
public static IEnumerable<IPublishedContent> ChildrenOfType(this IPublishedContent content, string contentTypeAlias, string culture = null)
{
return content.Children(x => alias.InvariantContains(x.ContentType.Alias), culture);
return content.Children(x => contentTypeAlias.InvariantContains(x.ContentType.Alias), culture);
}
/// <summary>
@@ -1010,9 +1010,9 @@ namespace Umbraco.Web
/// <summary>
/// Gets the first child of the content, of a given content type.
/// </summary>
public static IPublishedContent FirstChildOfType(this IPublishedContent content, string alias, string culture = null)
public static IPublishedContent FirstChildOfType(this IPublishedContent content, string contentTypeAlias, string culture = null)
{
return content.Children(culture,alias).FirstOrDefault();
return content.ChildrenOfType(contentTypeAlias, culture).FirstOrDefault();
}
public static IPublishedContent FirstChild(this IPublishedContent content, Func<IPublishedContent, bool> predicate, string culture = null)