Commit 8ff7c969 authored by Nick Craver's avatar Nick Craver

Cleanup: Extensions

parent 7382262a
...@@ -14,6 +14,7 @@ public static class ExtensionMethods ...@@ -14,6 +14,7 @@ public static class ExtensionMethods
/// <summary> /// <summary>
/// Create a dictionary from an array of HashEntry values /// Create a dictionary from an array of HashEntry values
/// </summary> /// </summary>
/// <param name="hash">The entry to convert to a dictionary.</param>
public static Dictionary<string,string> ToStringDictionary(this HashEntry[] hash) public static Dictionary<string,string> ToStringDictionary(this HashEntry[] hash)
{ {
if (hash == null) return null; if (hash == null) return null;
...@@ -28,6 +29,7 @@ public static class ExtensionMethods ...@@ -28,6 +29,7 @@ public static class ExtensionMethods
/// <summary> /// <summary>
/// Create a dictionary from an array of HashEntry values /// Create a dictionary from an array of HashEntry values
/// </summary> /// </summary>
/// <param name="hash">The entry to convert to a dictionary.</param>
public static Dictionary<RedisValue, RedisValue> ToDictionary(this HashEntry[] hash) public static Dictionary<RedisValue, RedisValue> ToDictionary(this HashEntry[] hash)
{ {
if (hash == null) return null; if (hash == null) return null;
...@@ -43,6 +45,7 @@ public static class ExtensionMethods ...@@ -43,6 +45,7 @@ public static class ExtensionMethods
/// <summary> /// <summary>
/// Create a dictionary from an array of SortedSetEntry values /// Create a dictionary from an array of SortedSetEntry values
/// </summary> /// </summary>
/// <param name="sortedSet">The set entries to convert to a dictionary.</param>
public static Dictionary<string, double> ToStringDictionary(this SortedSetEntry[] sortedSet) public static Dictionary<string, double> ToStringDictionary(this SortedSetEntry[] sortedSet)
{ {
if (sortedSet == null) return null; if (sortedSet == null) return null;
...@@ -58,6 +61,7 @@ public static class ExtensionMethods ...@@ -58,6 +61,7 @@ public static class ExtensionMethods
/// <summary> /// <summary>
/// Create a dictionary from an array of SortedSetEntry values /// Create a dictionary from an array of SortedSetEntry values
/// </summary> /// </summary>
/// <param name="sortedSet">The set entries to convert to a dictionary.</param>
public static Dictionary<RedisValue, double> ToDictionary(this SortedSetEntry[] sortedSet) public static Dictionary<RedisValue, double> ToDictionary(this SortedSetEntry[] sortedSet)
{ {
if (sortedSet == null) return null; if (sortedSet == null) return null;
...@@ -73,6 +77,7 @@ public static class ExtensionMethods ...@@ -73,6 +77,7 @@ public static class ExtensionMethods
/// <summary> /// <summary>
/// Create a dictionary from an array of key/value pairs /// Create a dictionary from an array of key/value pairs
/// </summary> /// </summary>
/// <param name="pairs">The pairs to convert to a dictionary.</param>
public static Dictionary<string, string> ToStringDictionary(this KeyValuePair<RedisKey, RedisValue>[] pairs) public static Dictionary<string, string> ToStringDictionary(this KeyValuePair<RedisKey, RedisValue>[] pairs)
{ {
if (pairs == null) return null; if (pairs == null) return null;
...@@ -88,6 +93,7 @@ public static class ExtensionMethods ...@@ -88,6 +93,7 @@ public static class ExtensionMethods
/// <summary> /// <summary>
/// Create a dictionary from an array of key/value pairs /// Create a dictionary from an array of key/value pairs
/// </summary> /// </summary>
/// <param name="pairs">The pairs to convert to a dictionary.</param>
public static Dictionary<RedisKey, RedisValue> ToDictionary(this KeyValuePair<RedisKey, RedisValue>[] pairs) public static Dictionary<RedisKey, RedisValue> ToDictionary(this KeyValuePair<RedisKey, RedisValue>[] pairs)
{ {
if (pairs == null) return null; if (pairs == null) return null;
...@@ -103,6 +109,7 @@ public static class ExtensionMethods ...@@ -103,6 +109,7 @@ public static class ExtensionMethods
/// <summary> /// <summary>
/// Create a dictionary from an array of string pairs /// Create a dictionary from an array of string pairs
/// </summary> /// </summary>
/// <param name="pairs">The pairs to convert to a dictionary.</param>
public static Dictionary<string, string> ToDictionary(this KeyValuePair<string, string>[] pairs) public static Dictionary<string, string> ToDictionary(this KeyValuePair<string, string>[] pairs)
{ {
if (pairs == null) return null; if (pairs == null) return null;
...@@ -115,10 +122,11 @@ public static class ExtensionMethods ...@@ -115,10 +122,11 @@ public static class ExtensionMethods
return result; return result;
} }
static readonly string[] nix = new string[0]; private static readonly string[] nix = new string[0];
/// <summary> /// <summary>
/// Create an array of strings from an array of values /// Create an array of strings from an array of values
/// </summary> /// </summary>
/// <param name="values">The values to convert to an array.</param>
public static string[] ToStringArray(this RedisValue[] values) public static string[] ToStringArray(this RedisValue[] values)
{ {
if (values == null) return null; if (values == null) return null;
......
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