示例#1
0
        /// <summary>
        /// Converts a generic object to JSON
        /// </summary>
        public static string ObjectToJson(object obj)
        {
            DynValue      v  = ObjectValueConverter.SerializeObjectToDynValue(null, obj, JsonNull.Create(), JsonEmptyArray.Create());
            StringBuilder sb = new StringBuilder();

            ValueToJson(sb, v);
            return(sb.ToString());
        }
示例#2
0
        /// <summary>
        /// Converts a generic object to JSON
        /// </summary>
        public static string ObjectToJson(object obj)
        {
            DynValue v = ObjectValueConverter.SerializeObjectToDynValue(null, obj, JsonNull.Create());

            return(JsonTableConverter.TableToJson(v.Table));
        }