renamed DynamicDocumentList to DynamicPublishedContentList

simplified some of the DynamicPublishedContent methods to accept Func<IPublishedContent> instead of Func<DynamicPublishedContent>, made the IsHelper method private as this shouldn't be exposed.
renamed other objects starting with DynamicDocument to DynamicPublishedContent
This commit is contained in:
Shannon Deminick
2012-10-02 22:51:53 +05:00
parent f3e04ac871
commit ef5525e67f
28 changed files with 140 additions and 140 deletions

View File

@@ -32,7 +32,7 @@ namespace Umbraco.Core.Dynamics
}
public static DynamicDocumentList Random(this DynamicDocumentList all, int min, int max)
public static DynamicPublishedContentList Random(this DynamicPublishedContentList all, int min, int max)
{
//get a random number generator
Random r = new Random();
@@ -41,13 +41,13 @@ namespace Umbraco.Core.Dynamics
//Call the other method
return Random(all, Number);
}
public static DynamicDocumentList Random(this DynamicDocumentList all, int max)
public static DynamicPublishedContentList Random(this DynamicPublishedContentList all, int max)
{
//Randomly order the items in the set by a Guid, Take the correct number, and return this wrapped in a new DynamicNodeList
return new DynamicDocumentList(all.Items.OrderBy(x => Guid.NewGuid()).Take(max));
return new DynamicPublishedContentList(all.Items.OrderBy(x => Guid.NewGuid()).Take(max));
}
public static DynamicPublishedContent Random(this DynamicDocumentList all)
public static DynamicPublishedContent Random(this DynamicPublishedContentList all)
{
return all.Items.OrderBy(x => Guid.NewGuid()).First();
}