Permalink
Browse files

Added Keys to ViewOptions

  • Loading branch information...
1 parent fd9114f commit 8258414a821a646530cf3e09fa45fa84de500d60 @NorthNick NorthNick committed Apr 14, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 LoveSeat/ViewOptions.cs
View
@@ -1,4 +1,6 @@
-using System;
+using System;
+using System.Collections.Generic;
+using System.Linq;
using System.Web;
using LoveSeat.Interfaces;
using Newtonsoft.Json;
@@ -18,7 +20,8 @@ public ViewOptions()
/// <summary>
/// If you have a complex object as a string set this using a JRaw object()
/// </summary>
- public IKeyOptions Key { get; set; }
+ public IKeyOptions Key { get; set; }
+ public IEnumerable<IKeyOptions> Keys { get; set; }
/// <summary>
/// If you have a complex object as a string set this using a JRaw object()
/// </summary>
@@ -46,7 +49,9 @@ public override string ToString()
{
string result = "";
if ((Key != null) && (Key.Count > 0))
- result += "&key=" + Key.ToString();
+ result += "&key=" + Key.ToString();
+ if (Keys != null)
+ result += "&keys=[" + String.Join(",", Keys.Select(k => k.ToString()).ToArray()) + "]";
if ((StartKey != null) && (StartKey.Count > 0))
if((StartKey.Count == 1) && (EndKey.Count > 1))
result += "&startkey=[" + StartKey.ToString() + "]";

0 comments on commit 8258414

Please sign in to comment.