Skip to content

Commit

Permalink
Added a new Apply method to add changes to collection of documents
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Bonacci committed Mar 18, 2010
1 parent 8f2515c commit 956647d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Extensions/Queries/MongoQueryExtensions.cs
Expand Up @@ -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.