标签:des style blog color io for
#region Helper public virtual void SerializeTo(ref Uri url, object queryJson) { if (queryJson != null) { Type type = queryJson.GetType(); url = new Uri(string.Format("{0}#{1}卐{2}", url.OriginalString, type.AssemblyQualifiedName, JsonConvert.SerializeObject(queryJson))); } } public virtual void DeserializeFrom(ref Uri url, out object queryJson) { queryJson = null; int i = url.OriginalString.LastIndexOf("#"); if (i != -1) { string[] param = url.OriginalString.Substring(i + 1).Split(‘卐‘); string typeName = param[0]; queryJson = JsonConvert.DeserializeObject(param[1], Type.GetType(typeName, true)); } } #endregion
标签:des style blog color io for
原文地址:http://www.cnblogs.com/Googler/p/3860060.html