public ActionResult Tweet() { var sendTweetVM = new SendTweetViewModel { Text = "Testing async LINQ to Twitter in MVC - " + DateTime.Now.ToString() }; return View(sendTweetVM); }
public async Task<ActionResult> TweetAsync(SendTweetViewModel tweet) { var auth = new MvcAuthorizer { CredentialStore = new SessionStateCredentialStore() }; var ctx = new TwitterContext(auth); Status responseTweet = await ctx.TweetAsync(tweet.Text); var responseTweetVM = new SendTweetViewModel { Text = "Testing async LINQ to Twitter in MVC - " + DateTime.Now.ToString(), Response = "Tweet successful! Response from Twitter: " + responseTweet.Text }; return View(responseTweetVM); }