///<summary> /// 序列化 ///</summary> public byte[] Serialize <T>(T o) { errorMessage = string.Empty; try { return(serializeBytes.Serialize(o)); } catch (Exception ex) { errorMessage = ex.ToExceptionDetail(); return(null); } }
///<summary> /// 序列化 ///</summary> public static byte[] ToBytes <T>(T o) { try { if (s_serializeBytes.IsNull()) { string classNameAndAssembly = WebConfig.GetApp("SerializeBytesProviderName"); Use(classNameAndAssembly); } return(s_serializeBytes.Serialize(o)); } catch (Exception ex) { throw ex; } }