Now we come to the part where we allow the user to send a tweet.
Open up the TwitterController class and add two actions called ComposeTweet and PublishTweet. The TwitterController class is really simple. It just contains the following code:
public class TwitterController : Controller { public IActionResult ComposeTweet() { return View(); } public IActionResult PublishTweet(string tweetText) { var firstTweet = Tweet.PublishTweet(tweetText); return RedirectToAction("GetHomeTimeline", "Home"); } }
The ComposeTweet action simply returns the user to a view where they can compose a tweet. You will remember that we created the ComposeTweet view earlier. The PublishTweet action is just as simple. It takes the ...