diff --git a/Raven.Client.Lightweight/Indexes/AbstractIndexCreationTask.cs b/Raven.Client.Lightweight/Indexes/AbstractIndexCreationTask.cs
index 6f453d592ac3..18975f966ca2 100644
--- a/Raven.Client.Lightweight/Indexes/AbstractIndexCreationTask.cs
+++ b/Raven.Client.Lightweight/Indexes/AbstractIndexCreationTask.cs
@@ -49,6 +49,14 @@ public abstract class AbstractIndexCreationTask
public DocumentConvention Conventions { get; set; }
#if !NET_3_5
+ ///
+ /// Allows to use lambdas recursively
+ ///
+ protected IEnumerable Recurse(TSource source, Func func)
+ {
+ throw new NotSupportedException("This can only be run on the server side");
+ }
+
///
/// Allows to use lambdas over dynamic
///
diff --git a/Raven.Database/Linq/AbstractViewGenerator.cs b/Raven.Database/Linq/AbstractViewGenerator.cs
index 157d9a134679..219b9881e10f 100644
--- a/Raven.Database/Linq/AbstractViewGenerator.cs
+++ b/Raven.Database/Linq/AbstractViewGenerator.cs
@@ -113,6 +113,27 @@ protected IEnumerable Hierarchy(object source, string name)
}
}
+ protected IEnumerable Recurse(object item, Func func)
+ {
+ if (item == null)
+ return Enumerable.Empty();
+
+ var resultsOrdered = new List();
+
+ var results = new HashSet