Skip to content

Commit 956647d

Browse files
author
Hugo Bonacci
committed
Added a new Apply method to add changes to collection of documents
1 parent 8f2515c commit 956647d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Extensions/Queries/MongoQueryExtensions.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,17 @@ public static IEnumerable<T> As<T>(this IEnumerable<MongoDocument> documents, st
2727
yield return document.Get(start, template);
2828
}
2929
}
30-
30+
31+
/// <summary>
32+
/// Selects information from the document in a specific format
33+
/// </summary>
34+
public static IEnumerable<MongoDocument> Apply(this IEnumerable<MongoDocument> documents, object parameters) {
35+
foreach(MongoDocument document in documents) {
36+
document.Merge(parameters);
37+
yield return document;
38+
}
39+
}
40+
3141
}
3242

3343
}

0 commit comments

Comments
 (0)