uQuery: Changed the generic base-type of a few extension methods.

This commit is contained in:
vertino
2012-06-05 23:53:28 -01:00
parent 0e0d5325f5
commit 7d46ae9e3e
2 changed files with 3 additions and 3 deletions

View File

@@ -135,7 +135,7 @@ namespace umbraco
/// <returns>
/// Returns the specified number of random content items from a collection of content items.
/// </returns>
public static IEnumerable<TSource> GetRandom<TSource>(this IList<TSource> items, int numberOfItems)
public static IEnumerable<TSource> GetRandom<TSource>(this ICollection<TSource> items, int numberOfItems)
{
if (numberOfItems > items.Count)
{

View File

@@ -456,7 +456,7 @@ namespace umbraco
/// <returns>
/// Returns a random node from a collection of nodes.
/// </returns>
public static Node GetRandom(this List<Node> nodes)
public static Node GetRandom(this IList<Node> nodes)
{
var random = umbraco.library.GetRandom();
return nodes[random.Next(0, (nodes.Count - 1))];
@@ -470,7 +470,7 @@ namespace umbraco
/// <returns>
/// Returns the specified number of random nodes from a collection of nodes.
/// </returns>
public static IEnumerable<Node> GetRandom(this List<Node> nodes, int numberOfItems)
public static IEnumerable<Node> GetRandom(this IList<Node> nodes, int numberOfItems)
{
var output = new List<Node>(numberOfItems);