Exemplo 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);
        }
Exemplo 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);
        }