@@ -70,7 +70,7 @@ public async Task<bool> ExistsAsync(RedisKey key, RedisValue item)
7070 /// <param name="key">Name of the key to return information about.</param>
7171 /// <returns>Information of the filter.</returns>
7272 /// <remarks><seealso href="https://redis.io/commands/bf.info"/></remarks>
73- public BloomInformation ? Info ( RedisKey key )
73+ public BloomInformation Info ( RedisKey key )
7474 {
7575 var info = _db . Execute ( BF . INFO , key ) ;
7676 return ResponseParser . ToBloomInfo ( info ) ;
@@ -82,7 +82,7 @@ public async Task<bool> ExistsAsync(RedisKey key, RedisValue item)
8282 /// <param name="key">Name of the key to return information about.</param>
8383 /// <returns>Information of the filter.</returns>
8484 /// <remarks><seealso href="https://redis.io/commands/bf.info"/></remarks>
85- public async Task < BloomInformation ? > InfoAsync ( RedisKey key )
85+ public async Task < BloomInformation > InfoAsync ( RedisKey key )
8686 {
8787 var info = await _db . ExecuteAsync ( BF . INFO , key ) ;
8888 return ResponseParser . ToBloomInfo ( info ) ;
@@ -108,8 +108,8 @@ public async Task<bool> ExistsAsync(RedisKey key, RedisValue item)
108108 double ? error = null , int ? expansion = null ,
109109 bool nocreate = false , bool nonscaling = false )
110110 {
111- if ( items == null )
112- throw new ArgumentNullException ( nameof ( items ) ) ;
111+ if ( items . Length < 1 )
112+ throw new ArgumentOutOfRangeException ( nameof ( items ) ) ;
113113
114114 List < object > args = new List < object > { key } ;
115115
@@ -119,6 +119,7 @@ public async Task<bool> ExistsAsync(RedisKey key, RedisValue item)
119119 args . Add ( capacity ) ;
120120 }
121121
122+
122123 if ( error != null )
123124 {
124125 args . Add ( BloomArgs . ERROR ) ;
@@ -171,8 +172,8 @@ public async Task<bool> ExistsAsync(RedisKey key, RedisValue item)
171172 double ? error = null , int ? expansion = null ,
172173 bool nocreate = false , bool nonscaling = false )
173174 {
174- if ( items == null )
175- throw new ArgumentNullException ( nameof ( items ) ) ;
175+ if ( items . Length < 1 )
176+ throw new ArgumentOutOfRangeException ( nameof ( items ) ) ;
176177
177178 List < object > args = new List < object > { key } ;
178179
@@ -221,11 +222,11 @@ public async Task<bool> ExistsAsync(RedisKey key, RedisValue item)
221222 /// <param name="key">Name of the key to restore.</param>
222223 /// <param name="iterator">Iterator value associated with data (returned by SCANDUMP).</param>
223224 /// <param name="data">Current data chunk (returned by SCANDUMP).</param>
224- /// <returns>Array with information of the filter. </returns>
225+ /// <returns><see langword="true"/> if executed correctly, error otherwise/> </returns>
225226 /// <remarks><seealso href="https://redis.io/commands/bf.loadchunk"/></remarks>
226227 public bool LoadChunk ( RedisKey key , long iterator , Byte [ ] data )
227228 {
228- return ResponseParser . ParseOKtoBoolean ( _db . Execute ( BF . LOADCHUNK , key , iterator , data ) ) ;
229+ return ResponseParser . OKtoBoolean ( _db . Execute ( BF . LOADCHUNK , key , iterator , data ) ) ;
229230 }
230231
231232 /// <summary>
@@ -234,12 +235,12 @@ public bool LoadChunk(RedisKey key, long iterator, Byte[] data)
234235 /// <param name="key">Name of the key to restore.</param>
235236 /// <param name="iterator">Iterator value associated with data (returned by SCANDUMP).</param>
236237 /// <param name="data">Current data chunk (returned by SCANDUMP).</param>
237- /// <returns>Array with information of the filter. </returns>
238+ /// <returns><see langword="true"/> if executed correctly, error otherwise/> </returns>
238239 /// <remarks><seealso href="https://redis.io/commands/bf.loadchunk"/></remarks>
239240 public async Task < bool > LoadChunkAsync ( RedisKey key , long iterator , Byte [ ] data )
240241 {
241242 var result = await _db . ExecuteAsync ( BF . LOADCHUNK , key , iterator , data ) ;
242- return ResponseParser . ParseOKtoBoolean ( result ) ;
243+ return ResponseParser . OKtoBoolean ( result ) ;
243244 }
244245
245246 /// <summary>
@@ -250,10 +251,10 @@ public async Task<bool> LoadChunkAsync(RedisKey key, long iterator, Byte[] data)
250251 /// <returns>An array of booleans. Each element is either true or false depending on whether the
251252 /// corresponding input element was newly added to the filter or may have previously existed.</returns>
252253 /// <remarks><seealso href="https://redis.io/commands/bf.madd"/></remarks>
253- public bool [ ] MAdd ( RedisKey key , RedisValue [ ] items )
254+ public bool [ ] MAdd ( RedisKey key , params RedisValue [ ] items )
254255 {
255- if ( items == null )
256- throw new ArgumentNullException ( nameof ( items ) ) ;
256+ if ( items . Length < 1 )
257+ throw new ArgumentOutOfRangeException ( nameof ( items ) ) ;
257258
258259 List < object > args = new List < object > { key } ;
259260
@@ -273,10 +274,10 @@ public bool[] MAdd(RedisKey key, RedisValue[] items)
273274 /// <returns>An array of booleans. Each element is either true or false depending on whether the
274275 /// corresponding input element was newly added to the filter or may have previously existed.</returns>
275276 /// <remarks><seealso href="https://redis.io/commands/bf.madd"/></remarks>
276- public async Task < bool [ ] > MAddAsync ( RedisKey key , RedisValue [ ] items )
277+ public async Task < bool [ ] > MAddAsync ( RedisKey key , params RedisValue [ ] items )
277278 {
278- if ( items == null )
279- throw new ArgumentNullException ( nameof ( items ) ) ;
279+ if ( items . Length < 1 )
280+ throw new ArgumentOutOfRangeException ( nameof ( items ) ) ;
280281
281282 List < object > args = new List < object > { key } ;
282283
@@ -299,8 +300,8 @@ public async Task<bool[]> MAddAsync(RedisKey key, RedisValue[] items)
299300 /// <remarks><seealso href="https://redis.io/commands/bf.mexists"/></remarks>
300301 public bool [ ] MExists ( RedisKey key , RedisValue [ ] items )
301302 {
302- if ( items == null )
303- throw new ArgumentNullException ( nameof ( items ) ) ;
303+ if ( items . Length < 1 )
304+ throw new ArgumentOutOfRangeException ( nameof ( items ) ) ;
304305
305306 List < object > args = new List < object > { key } ;
306307
@@ -323,8 +324,8 @@ public bool[] MExists(RedisKey key, RedisValue[] items)
323324 /// <remarks><seealso href="https://redis.io/commands/bf.mexists"/></remarks>
324325 public async Task < bool [ ] > MExistsAsync ( RedisKey key , RedisValue [ ] items )
325326 {
326- if ( items == null )
327- throw new ArgumentNullException ( nameof ( items ) ) ;
327+ if ( items . Length < 1 )
328+ throw new ArgumentOutOfRangeException ( nameof ( items ) ) ;
328329
329330 List < object > args = new List < object > { key } ;
330331
@@ -348,7 +349,7 @@ public async Task<bool[]> MExistsAsync(RedisKey key, RedisValue[] items)
348349 /// created in size of the last sub-filter multiplied by expansion.</param>
349350 /// <param name="nonscaling">(Optional) <see langword="true"/> toprevent the filter
350351 /// from creating additional sub-filters if initial capacity is reached.</param>
351- /// <returns><see langword="true"/> if executed correctly, <see langword="false"/> otherwise. </returns>
352+ /// <returns><see langword="true"/> if executed correctly, error otherwise/> </returns>
352353 /// <remarks><seealso href="https://redis.io/commands/bf.reserve"/></remarks>
353354 public bool Reserve ( RedisKey key , double errorRate , long capacity ,
354355 int ? expansion = null , bool nonscaling = false )
@@ -365,7 +366,7 @@ public bool Reserve(RedisKey key, double errorRate, long capacity,
365366 args . Add ( BloomArgs . NONSCALING ) ;
366367 }
367368
368- return ResponseParser . ParseOKtoBoolean ( _db . Execute ( BF . RESERVE , args ) ) ;
369+ return ResponseParser . OKtoBoolean ( _db . Execute ( BF . RESERVE , args ) ) ;
369370 }
370371
371372 /// <summary>
@@ -378,7 +379,7 @@ public bool Reserve(RedisKey key, double errorRate, long capacity,
378379 /// created in size of the last sub-filter multiplied by expansion.</param>
379380 /// <param name="nonscaling">(Optional) <see langword="true"/> toprevent the filter
380381 /// from creating additional sub-filters if initial capacity is reached.</param>
381- /// <returns><see langword="true"/> if executed correctly, <see langword="false"/> otherwise.</returns>
382+ /// <returns><see langword="true"/> if executed correctly, Error otherwise.</returns>
382383 /// <remarks><seealso href="https://redis.io/commands/bf.reserve"/></remarks>
383384 public async Task < bool > ReserveAsync ( RedisKey key , double errorRate , long capacity ,
384385 int ? expansion = null , bool nonscaling = false )
@@ -396,7 +397,7 @@ public async Task<bool> ReserveAsync(RedisKey key, double errorRate, long capaci
396397 }
397398
398399 var result = await _db . ExecuteAsync ( BF . RESERVE , args ) ;
399- return ResponseParser . ParseOKtoBoolean ( result ) ;
400+ return ResponseParser . OKtoBoolean ( result ) ;
400401 }
401402
402403 /// <summary>
@@ -406,7 +407,7 @@ public async Task<bool> ReserveAsync(RedisKey key, double errorRate, long capaci
406407 /// <param name="iterator">Iterator value; either 0 or the iterator from a previous invocation of this command.</param>
407408 /// <returns>Tuple of iterator and data.</returns>
408409 /// <remarks><seealso href="https://redis.io/commands/bf.scandump"/></remarks>
409- public Tuple < long , Byte [ ] > ? ScanDump ( RedisKey key , long iterator )
410+ public Tuple < long , Byte [ ] > ScanDump ( RedisKey key , long iterator )
410411 {
411412 return ResponseParser . ToScanDumpTuple ( _db . Execute ( BF . SCANDUMP , key , iterator ) ) ;
412413 }
@@ -418,7 +419,7 @@ public async Task<bool> ReserveAsync(RedisKey key, double errorRate, long capaci
418419 /// <param name="iterator">Iterator value; either 0 or the iterator from a previous invocation of this command.</param>
419420 /// <returns>Tuple of iterator and data.</returns>
420421 /// <remarks><seealso href="https://redis.io/commands/bf.scandump"/></remarks>
421- public async Task < Tuple < long , Byte [ ] > ? > ScanDumpAsync ( RedisKey key , long iterator )
422+ public async Task < Tuple < long , Byte [ ] > > ScanDumpAsync ( RedisKey key , long iterator )
422423 {
423424 var result = await _db . ExecuteAsync ( BF . SCANDUMP , key , iterator ) ;
424425 return ResponseParser . ToScanDumpTuple ( result ) ;
0 commit comments