File tree 1 file changed +28
-0
lines changed
src/Persistence/Wolverine.Marten
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,22 @@ public static StoreManyDocs<T> StoreMany<T>(params T[] documents) where T : notn
55
55
return new StoreManyDocs < T > ( documents ) ;
56
56
}
57
57
58
+ /// <summary>
59
+ /// Return a side effect of storing an enumerable of potentially mixed documents in Marten
60
+ /// </summary>
61
+ /// <param name="documents"></param>
62
+ /// <returns></returns>
63
+ /// <exception cref="ArgumentNullException"></exception>
64
+ public static StoreObjects StoreObjects ( params object [ ] documents )
65
+ {
66
+ if ( documents == null )
67
+ {
68
+ throw new ArgumentNullException ( nameof ( documents ) ) ;
69
+ }
70
+
71
+ return new StoreObjects ( documents ) ;
72
+ }
73
+
58
74
/// <summary>
59
75
/// Return a side effect of inserting the specified document in Marten
60
76
/// </summary>
@@ -273,6 +289,18 @@ public override void Execute(IDocumentSession session)
273
289
}
274
290
}
275
291
292
+ public class StoreObjects : DocumentsOp
293
+ {
294
+ public StoreObjects ( params object [ ] documents ) : base ( documents ) { }
295
+
296
+ public StoreObjects ( IList < object > documents ) : this ( documents . ToArray ( ) ) { }
297
+
298
+ public override void Execute ( IDocumentSession session )
299
+ {
300
+ session . StoreObjects ( Documents ) ;
301
+ }
302
+ }
303
+
276
304
public class InsertDoc < T > : DocumentOp where T : notnull
277
305
{
278
306
private readonly T _document ;
You can’t perform that action at this time.
0 commit comments