@@ -141,7 +141,7 @@ private string GenerateBulkCommand<T>(IEnumerable<BulkParameters<T>> objects, st
141
141
}
142
142
private string GenerateBulkCommand < T > ( IEnumerable < T > objects , string index , string command ) where T : class
143
143
{
144
- objects . ThrowIfNull ( "objects" ) ;
144
+ objects . ThrowIfEmpty ( "objects" ) ;
145
145
index . ThrowIfNullOrEmpty ( "index" ) ;
146
146
147
147
var type = typeof ( T ) ;
@@ -151,7 +151,7 @@ private string GenerateBulkCommand<T>(IEnumerable<T> objects, string index, stri
151
151
}
152
152
private string GenerateBulkCommand < T > ( IEnumerable < BulkParameters < T > > objects , string index , string command ) where T : class
153
153
{
154
- objects . ThrowIfNull ( "objects" ) ;
154
+ objects . ThrowIfEmpty ( "objects" ) ;
155
155
index . ThrowIfNullOrEmpty ( "index" ) ;
156
156
157
157
var type = typeof ( T ) ;
@@ -163,8 +163,7 @@ private string GenerateBulkCommand<T>(IEnumerable<BulkParameters<T>> objects, st
163
163
164
164
private string GenerateBulkCommand < T > ( IEnumerable < T > @objects , string index , string typeName , string command ) where T : class
165
165
{
166
- if ( ! @objects . Any ( ) )
167
- return null ;
166
+ objects . ThrowIfEmpty ( "objects" ) ;
168
167
169
168
var sb = new StringBuilder ( ) ;
170
169
var action = "{{ \" {0}\" : {{ \" _index\" : \" {1}\" , \" _type\" : \" {2}\" " . F ( command , index , typeName ) ;
@@ -194,8 +193,7 @@ private string GenerateBulkCommand<T>(IEnumerable<T> @objects, string index, str
194
193
}
195
194
private string GenerateBulkCommand < T > ( IEnumerable < BulkParameters < T > > @objects , string index , string typeName , string command ) where T : class
196
195
{
197
- if ( ! @objects . Any ( ) )
198
- return null ;
196
+ objects . ThrowIfEmpty ( "objects" ) ;
199
197
200
198
var sb = new StringBuilder ( ) ;
201
199
var action = "{{ \" {0}\" : {{ \" _index\" : \" {1}\" , \" _type\" : \" {2}\" " . F ( command , index , typeName ) ;
0 commit comments