Updating controllers and views

Let's execute the following steps for updating controllers and views:

  1. In your project tree, browse to the Controllers folder and add the following TweetsController class. This controller will load the DB context and populate the tweet scores list. The controller class code is below:
        using System.Linq;        using Microsoft.AspNetCore.Mvc;        using TextScoreDashboard.Models;        namespace TextScoreDashboard.Controllers        {          public class TweetsController : Controller          {            private TextScoresDBContext _context;            public TweetsController(TextScoresDBContext context)            {              _context = context;            }            public IActionResult Index()            {              return View(_context.TweetTextScore.ToList());            }          }       }
  1. Under the Views folder, add a folder called Tweets.
  2. In the ...

Get Serverless computing in Azure with .NET 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.