title: How to pass an array to StackExchange.Redis method taking RedisValue[]?
body: <p>I'd like to call <code>IDatabase.SortedSetAsync</code> (StackExchange.Redis). The signature for this method is:</p>
  
  <pre><code>Task&lt;bool&gt; SortedSetRemoveAsync(RedisKey key, RedisValue member,
          CommandFlags flags = CommandFlags.None);
  Task&lt;long&gt; SortedSetRemoveAsync(RedisKey key, RedisValue[] members,
          CommandFlags flags = CommandFlags.None);
  </code></pre>
  
  <p>I have no problem passing a single value (e.g. a string) which gets implicitly converted to RevisValue. However, if I try passing in an array...</p>
  
  <pre><code>var key = "MYKEY";
  var values = new string[] { "A", "B", "C" };
  
  await database.SortedSetRemoveAsync(key, values);
  </code></pre>
  
  <p>...then the compiler has no idea how to convert the string[] to a RedisValue[].</p>
  
  <p>The only way I managed the conversion is by making a per-item conversion:</p>
  
  <pre><code>var values2 = values.Select(s =&gt; (Redisvalue) s).ToArray();
  await database.SortedSetRemoveAsync(key, values2);
  </code></pre>
  
  <p>...and I'm not sure whether that's the best way to do it.</p>
  
  <p>It's quite strange that it's so hard to pass an array when there are API methods expecting arrays... the <a href="https://github.com/StackExchange/StackExchange.Redis/blob/master/StackExchange.Redis.Tests/WrapperBaseTests.cs" rel="noreferrer">unit tests</a> take an easy direction by passing in an empty RedisValue[] array and bypassing the problem altogether.</p>
  
  <p>What is the recommended way to pass array arguments to StackExchange.Redis methods accepting RedisValue[] arrays?</p>