/// <summary> /// A blocking function used to simplify the entire process of responding with a JSON object. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="response"></param> /// <param name="responseObject"></param> /// <param name="statusCode"></param> /// <param name="statusDescription"></param> public static void WriteJsonResponse <T>(this HttpListenerResponse response, T responseObject, int statusCode = 200, string statusDescription = "OK") { WriteJsonStringResponse(response, MySerialize.JsonStringify(responseObject), statusCode, statusDescription); }
public string SerializeObject <T>(T objectToSerialize) { return(MySerialize.JsonStringify(objectToSerialize)); }
public T GetObject() { return(MySerialize.JsonParse <T>(data)); }
private object DeserializeGeneral(string objectToDeserialize, Type t) { return(MySerialize.JsonParse(objectToDeserialize, t)); }
public void SetObject(T transportObject) { data = MySerialize.JsonStringify(transportObject, false); }