Exemplo n.º 1
0
 ///<summary>
 /// 序列化
 ///</summary>
 public string Serialize <T>(T o)
 {
     errorMessage = string.Empty;
     try {
         return(serializeString.Serialize(o));
     } catch (Exception ex) {
         errorMessage = ex.ToExceptionDetail();
         return(null);
     }
 }
Exemplo n.º 2
0
 ///<summary>
 /// 序列化
 ///</summary>
 public static string ToJson <T>(T o)
 {
     try {
         if (s_serializeString.IsNull())
         {
             string classNameAndAssembly = WebConfig.GetApp("SerializeJsonProviderName");
             Use(classNameAndAssembly);
         }
         return(s_serializeString.Serialize(o));
     } catch (Exception ex) {
         throw ex;
     }
 }