123456789101112131415161718192021222324252627 |
- 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<T>(this string JsonStr)
- {
- T objs = serial.Deserialize<T>(JsonStr);
- return objs;
- }
- }
- }
|