//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - public TweetJsonFormat(TweetViewModel tweetViewModel) { this.Id = tweetViewModel.Id; this.DatePublished = tweetViewModel.DatePublished; this.Text = tweetViewModel.Text; this.PersonId = tweetViewModel.PersonId; this.ResponseId = tweetViewModel.ResponseId; // this.Likes = tweetViewModel.Likes; // this.Images = tweetViewModel.Images; this.Likes = Like.ParseLikes(tweetViewModel.Likes); this.Images = TweetJsonFormat.ParseImages(tweetViewModel.Images); }
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - public TweetViewModel(string strJson_I) { if (string.IsNullOrWhiteSpace(strJson_I)) { return; } TweetViewModel tweetViewModel = JsonConvert.DeserializeObject <TweetViewModel>(strJson_I); this.Id = tweetViewModel.Id; this.Likes = tweetViewModel.Likes; this.DatePublished = tweetViewModel.DatePublished; this.Text = tweetViewModel.Text; this.Images = tweetViewModel.Images; this.PersonId = tweetViewModel.PersonId; this.ResponseId = tweetViewModel.ResponseId; }