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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user