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