Let's execute the following steps for updating controllers and views:
- 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()); } } }
- Under the Views folder, add a folder called Tweets.
- In the ...