Пример #1
0
 public ActionResult ReTweet(ReTweetBindingModel model)
 {
     if (model != null && this.ModelState.IsValid)
     {
         // Todo save retweet
     }
     return this.View("_ReTweetPartial", model);
 }
Пример #2
0
 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);
 }
Пример #3
0
 public ActionResult ReTweet(int id)
 {
     var bindingModel = new ReTweetBindingModel { TweetId = id };
     return this.View("_ReTweetPartial", bindingModel);
 }