Permalink
Browse files

Added a new Apply method to add changes to collection of documents

  • Loading branch information...
1 parent 8f2515c commit 956647de1f75cd1be203d4024d365ffaace29833 Hugo Bonacci committed Mar 18, 2010
Showing with 11 additions and 1 deletion.
  1. +11 −1 Extensions/Queries/MongoQueryExtensions.cs
@@ -27,7 +27,17 @@ public static class MongoQueryExtensions {
yield return document.Get(start, template);
}
}
-
+
+ /// <summary>
+ /// Selects information from the document in a specific format
+ /// </summary>
+ public static IEnumerable<MongoDocument> Apply(this IEnumerable<MongoDocument> documents, object parameters) {
+ foreach(MongoDocument document in documents) {
+ document.Merge(parameters);
+ yield return document;
+ }
+ }
+
}
}

0 comments on commit 956647d

Please sign in to comment.