Beispiel #1
0
        public static string ToJson(this object obj, string datetimeformats)
        {
            var timeConverter = new IsoDateTimeConverter {
                DateTimeFormat = datetimeformats
            };
            var longConverter = new LongJsonConvert();

            return(JsonConvert.SerializeObject(obj, timeConverter, longConverter));
        }
Beispiel #2
0
        public static string ToJson(this object obj)
        {
            var timeConverter = new IsoDateTimeConverter {
                DateTimeFormat = "yyyy-MM-dd HH:mm:ss"
            };
            var longConverter = new LongJsonConvert();

            return(JsonConvert.SerializeObject(obj, timeConverter, longConverter));
        }