sharp-jsonrpc/Response.cs

26 lines
554 B
C#
Raw Normal View History

2017-09-18 11:30:23 +02:00
using System;
using Newtonsoft.Json.Linq;
using System.Threading;
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json;
using System.Collections.Generic;
2017-10-17 21:43:50 +02:00
namespace sharp.jsonrpc
2017-09-18 11:30:23 +02:00
{
public class Response {
public string jsonrpc { get; set; }
public string id { get; set; }
public Dictionary<string, JToken> result { get; set; }
2017-10-17 21:43:50 +02:00
public string error { get; set; }
2017-09-18 11:30:23 +02:00
public Response(string source){
JsonConvert.PopulateObject(source,this);
}
public bool Success(){
return result["status"].ToString().Equals("OK");
}
}
}