Changed RestObject dictionary value to object so you can add things besides strings.
This commit is contained in:
parent
c72a80a51a
commit
81797667e9
1 changed files with 6 additions and 6 deletions
|
|
@ -4,21 +4,21 @@ using System.Collections.Generic;
|
|||
namespace Rests
|
||||
{
|
||||
[Serializable]
|
||||
public class RestObject : Dictionary<string, string>
|
||||
public class RestObject : Dictionary<string, object>
|
||||
{
|
||||
public string Status
|
||||
{
|
||||
get { return this["status"]; }
|
||||
get { return this["status"] as string; }
|
||||
set { this["status"] = value; }
|
||||
}
|
||||
public string Error
|
||||
{
|
||||
get { return this["error"]; }
|
||||
get { return this["error"] as string; }
|
||||
set { this["error"] = value; }
|
||||
}
|
||||
public string Response
|
||||
{
|
||||
get { return this["response"]; }
|
||||
get { return this["response"] as string; }
|
||||
set { this["response"] = value; }
|
||||
}
|
||||
|
||||
|
|
@ -33,11 +33,11 @@ namespace Rests
|
|||
/// <param name="key"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns>Returns null if key does not exist.</returns>
|
||||
public new string this[string key]
|
||||
public new object this[string key]
|
||||
{
|
||||
get
|
||||
{
|
||||
string ret;
|
||||
object ret;
|
||||
if (TryGetValue(key, out ret))
|
||||
return ret;
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue