File tree Expand file tree Collapse file tree 2 files changed +10
-14
lines changed Expand file tree Collapse file tree 2 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -190,10 +190,6 @@ public virtual CommandResult AggregateExplain(AggregateArgs args)
190
190
/// </returns>
191
191
public virtual BulkWriteResult BulkWrite ( BulkWriteArgs args )
192
192
{
193
- if ( ! args . Requests . Any ( ) )
194
- {
195
- throw new ArgumentException ( "No requests specified in bulk operation." , "args" ) ;
196
- }
197
193
var connection = _server . AcquireConnection ( ReadPreference . Primary ) ;
198
194
try
199
195
{
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ public class BulkWriteArgs
28
28
private bool ? _isOrdered ;
29
29
private int ? _maxBatchCount ;
30
30
private int ? _maxBatchLength ;
31
+ private IEnumerable < WriteRequest > _requests = new List < WriteRequest > ( ) ;
31
32
private WriteConcern _writeConcern ;
32
- private IList < WriteRequest > _requests = new List < WriteRequest > ( ) ;
33
33
34
34
// public properties
35
35
/// <summary>
@@ -89,6 +89,15 @@ public int? MaxBatchLength
89
89
set { _maxBatchLength = value ; }
90
90
}
91
91
92
+ /// <summary>
93
+ /// Gets or sets the write requests.
94
+ /// </summary>
95
+ public IEnumerable < WriteRequest > Requests
96
+ {
97
+ get { return _requests ; }
98
+ set { _requests = value ?? new List < WriteRequest > ( ) ; }
99
+ }
100
+
92
101
/// <summary>
93
102
/// Gets or sets the write concern.
94
103
/// </summary>
@@ -100,14 +109,5 @@ public WriteConcern WriteConcern
100
109
get { return _writeConcern ; }
101
110
set { _writeConcern = value ; }
102
111
}
103
-
104
- /// <summary>
105
- /// Gets or sets the write requests.
106
- /// </summary>
107
- public IList < WriteRequest > Requests
108
- {
109
- get { return _requests ; }
110
- set { _requests = value ?? new List < WriteRequest > ( ) ; }
111
- }
112
112
}
113
113
}
You can’t perform that action at this time.
0 commit comments