Commit b8a440ba authored by Marc Gravell's avatar Marc Gravell

fix #856 - add method to create a RedisResult that represents an array;...

fix #856 - add method to create a RedisResult that represents an array; mirrors existing factory method re single values
parent 624dd042
...@@ -8,12 +8,20 @@ namespace StackExchange.Redis ...@@ -8,12 +8,20 @@ namespace StackExchange.Redis
public abstract class RedisResult public abstract class RedisResult
{ {
/// <summary> /// <summary>
/// Create a new RedisResult. /// Create a new RedisResult representing a single value.
/// </summary> /// </summary>
/// <param name="value">The <see cref="RedisValue"/> to create a result from.</param> /// <param name="value">The <see cref="RedisValue"/> to create a result from.</param>
/// <returns> new <see cref="RedisResult"/>.</returns> /// <returns> new <see cref="RedisResult"/>.</returns>
public static RedisResult Create(RedisValue value) => new SingleRedisResult(value); public static RedisResult Create(RedisValue value) => new SingleRedisResult(value);
/// <summary>
/// Create a new RedisResult representing an array of values.
/// </summary>
/// <param name="values">The <see cref="RedisValue"/>s to create a result from.</param>
/// <returns> new <see cref="RedisResult"/>.</returns>
public static RedisResult Create(RedisValue[] values) => new ArrayRedisResult(
values == null ? null : Array.ConvertAll(values, value => new SingleRedisResult(value)));
// internally, this is very similar to RawResult, except it is designed to be usable // internally, this is very similar to RawResult, except it is designed to be usable
// outside of the IO-processing pipeline: the buffers are standalone, etc // outside of the IO-processing pipeline: the buffers are standalone, etc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment