Ejemplo n.º 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());
        }
Ejemplo n.º 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));
        }