public ActionResult ReTweet(ReTweetBindingModel model) { if (model != null && this.ModelState.IsValid) { // Todo save retweet } return this.View("_ReTweetPartial", model); }
public ActionResult ReTweet(ReTweetBindingModel model) { if (model != null && this.ModelState.IsValid) { var tweet = this.TwitterData.Tweets.Find(model.TweetId); tweet.Retweets.Add(new Tweet { Content = model.Content, TweetedAt = DateTime.Now }); this.TwitterData.SaveChanges(); this.TempData[GlobalConstants.TempMessageKey] = "You have successfully retweeted!"; return this.RedirectToAction("Home", "Users"); } this.TempData[GlobalConstants.TempMessageKey] = "Error during retweet"; return this.View("_ReTweetPartial", model); }
public ActionResult ReTweet(int id) { var bindingModel = new ReTweetBindingModel { TweetId = id }; return this.View("_ReTweetPartial", bindingModel); }