using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.Script.Serialization; namespace Bowin.Common.Linq { public static class InterfaceConvertor { private static JavaScriptSerializer serial = new JavaScriptSerializer(); public static string ToJson(this object i) { return serial.Serialize(i); } public static T JSONStringToClass(this string JsonStr) { T objs = serial.Deserialize(JsonStr); return objs; } } }