예제 #1
0
        public static LastShout ParseJToken(JToken token)
        {
            var s = new LastShout();

            s.Body = token.Value<string>("body");
            s.Author = token.Value<string>("author");
            
            var date = token.Value<string>("date");
            DateTimeOffset postedAt;
            if (DateTimeOffset.TryParse(date, out postedAt))
            {
                s.TimePosted = postedAt;
            }

            return s;
        }
예제 #2
0
        public static LastShout ParseJToken(JToken token)
        {
            var s = new LastShout();

            s.Body   = token.Value <string>("body");
            s.Author = token.Value <string>("author");

            var            date = token.Value <string>("date");
            DateTimeOffset postedAt;

            if (DateTimeOffset.TryParse(date, out postedAt))
            {
                s.TimePosted = postedAt;
            }

            return(s);
        }