Creating the HomeTimeline view

Thinking back to the HomeController action we created earlier called GetHomeTimeline, you will remember that we routed to a view called HomeTimeline. We have already created this view, but now we need to add some logic to it to render the tweets in our home timeline.

We, therefore, need to add a view for our home timeline, which we will add next:

  1. Open the HomeTimeline.cshtml file and add the following markup to the view:
@model TwitterViewModel @{ ViewBag.Title = "What's happening?"; } <h2>Home - Timeline</h2> <div class="row"> <div class="col-md-8"> @foreach (var tweet in Model.HomeTimelineTweets) { <blockquote class="twitter-tweet"> <p lang="en" dir="ltr"> <a href="@Html.DisplayFor(m => tweet.Url)"></a> ...

Get C# 7 and .NET Core 2.0 Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.