Refactored the traversal, ishelper, etc... methods to be extension methods on IPublishedContent so now all of these methods are available on the Typed object not just the dynamic object which makes a whole lot more sense... and you can have intellisense.

Updated DynamicPublishedContent's methods to just proxy calls to the new extension methods so that all of the logic is contained in one place.
Added new GetRootDocuments to the IPublishedContentStore since we need this in order to get the root list of documents for many of these methods.
Fixed an issue with the DynamicNode to IPublishedContent converter.
Fixed many of the failing unit tests.
This commit is contained in:
Shannon Deminick
2012-10-04 01:31:08 +05:00
parent 831d1966dc
commit c0102f1c71
40 changed files with 2391 additions and 2120 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Models;
namespace Umbraco.Core.Dynamics
{
@@ -47,7 +48,7 @@ namespace Umbraco.Core.Dynamics
return new DynamicPublishedContentList(all.Items.OrderBy(x => Guid.NewGuid()).Take(max));
}
public static DynamicPublishedContent Random(this DynamicPublishedContentList all)
public static DynamicPublishedContentBase Random(this DynamicPublishedContentList all)
{
return all.Items.OrderBy(x => Guid.NewGuid()).First();
}