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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.