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 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.