Changed RestObject dictionary value to object so you can add things besides strings.

This commit is contained in:
high 2011-09-06 01:23:49 -04:00
parent c72a80a51a
commit 81797667e9

View file

@ -4,21 +4,21 @@ using System.Collections.Generic;
namespace Rests namespace Rests
{ {
[Serializable] [Serializable]
public class RestObject : Dictionary<string, string> public class RestObject : Dictionary<string, object>
{ {
public string Status public string Status
{ {
get { return this["status"]; } get { return this["status"] as string; }
set { this["status"] = value; } set { this["status"] = value; }
} }
public string Error public string Error
{ {
get { return this["error"]; } get { return this["error"] as string; }
set { this["error"] = value; } set { this["error"] = value; }
} }
public string Response public string Response
{ {
get { return this["response"]; } get { return this["response"] as string; }
set { this["response"] = value; } set { this["response"] = value; }
} }
@ -33,11 +33,11 @@ namespace Rests
/// <param name="key"></param> /// <param name="key"></param>
/// <param name="value"></param> /// <param name="value"></param>
/// <returns>Returns null if key does not exist.</returns> /// <returns>Returns null if key does not exist.</returns>
public new string this[string key] public new object this[string key]
{ {
get get
{ {
string ret; object ret;
if (TryGetValue(key, out ret)) if (TryGetValue(key, out ret))
return ret; return ret;
return null; return null;