Esempio n. 1
0
        public static string SerializeAndFormat <T>(this T instance)
        {
            var dtoStr    = SerializeToString(instance);
            var formatStr = JsvFormatter.Format(dtoStr);

            return(formatStr);
        }
        public static string SerializeAndFormat <T>(this T instance)
        {
            var fn = instance as Delegate;

            if (fn != null)
            {
                return(Dump(fn));
            }

            var dtoStr    = SerializeToString(instance);
            var formatStr = JsvFormatter.Format(dtoStr);

            return(formatStr);
        }
Esempio n. 3
0
        public static string SerializeAndFormat <T>(this T instance)
        {
            if (instance is Delegate fn)
            {
                return(Dump(fn));
            }

            var dtoStr = !HasCircularReferences(instance)
                ? SerializeToString(instance)
                : SerializeToString(instance.ToSafePartialObjectDictionary());
            var formatStr = JsvFormatter.Format(dtoStr);

            return(formatStr);
        }