The InformationController class

The next step we need to take is to add the controller for our application:

  1. Right-click the Controllers folder and select Add, and then click on Controller from the context menu:
  1. Add a new controller called InformationController by selecting MVC Controller - Empty from the Add Scaffold screen. The following using statements need to be added to the controller:
using DarkSky.Models; using DarkSky.Services; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using System.Globalization; using System.IO; using System.Net.Http; using System.Runtime.InteropServices; using ...

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

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