Merge remote-tracking branch 'origin/6.2.0' into 6.2.0

This commit is contained in:
Stephan
2013-10-31 15:29:16 +01:00
2 changed files with 32 additions and 0 deletions

View File

@@ -204,6 +204,9 @@ namespace Umbraco.Core.Persistence.Repositories
Database.Delete<PropertyTypeDto>("WHERE id = @Id", new { Id = dto.Id });
}
//Delete the pre-values
Database.Delete<DataTypePreValueDto>("WHERE datatypeNodeId = @Id", new {Id = entity.Id});
//Delete Content specific data
Database.Delete<DataTypeDto>("WHERE nodeId = @Id", new { Id = entity.Id });

View File

@@ -1065,6 +1065,35 @@ namespace Umbraco.Web
#region Axes: descendants, descendants-or-self
/// <summary>
/// Returns all DescendantsOrSelf of all content referenced
/// </summary>
/// <param name="parentNodes"></param>
/// <param name="docTypeAlias"></param>
/// <returns></returns>
/// <remarks>
/// This can be useful in order to return all nodes in an entire site by a type when combined with TypedContentAtRoot
/// </remarks>
public static IEnumerable<IPublishedContent> DescendantsOrSelf(this IEnumerable<IPublishedContent> parentNodes, string docTypeAlias)
{
return parentNodes.SelectMany(x => x.DescendantsOrSelf(docTypeAlias));
}
/// <summary>
/// Returns all DescendantsOrSelf of all content referenced
/// </summary>
/// <param name="parentNodes"></param>
/// <returns></returns>
/// <remarks>
/// This can be useful in order to return all nodes in an entire site by a type when combined with TypedContentAtRoot
/// </remarks>
public static IEnumerable<T> DescendantsOrSelf<T>(this IEnumerable<IPublishedContent> parentNodes)
where T : class, IPublishedContent
{
return parentNodes.SelectMany(x => x.DescendantsOrSelf<T>());
}
// as per XPath 1.0 specs §2.2,
// - the descendant axis contains the descendants of the context node; a descendant is a child or a child of a child and so on; thus
// the descendant axis never contains attribute or namespace nodes.