porting 7.6-rc1 into 8

This commit is contained in:
Stephan
2017-05-12 14:49:44 +02:00
parent ade6c2f057
commit 8561d85f7a
1148 changed files with 41983 additions and 17045 deletions

View File

@@ -1058,6 +1058,17 @@ namespace Umbraco.Web
return content.Children().FirstOrDefault();
}
/// <summary>
/// Gets the first child of the content, of a given content type.
/// </summary>
/// <param name="content">The content.</param>
/// <param name="alias">The content type alias.</param>
/// <returns>The first child of content, of the given content type.</returns>
public static IPublishedContent FirstChild(this IPublishedContent content, string alias)
{
return content.Children( alias ).FirstOrDefault();
}
public static IPublishedContent FirstChild(this IPublishedContent content, Func<IPublishedContent, bool> predicate)
{
return content.Children(predicate).FirstOrDefault();