The Startup.cs file

Digging deeper into the code, let's start at the Startup.cs file. It should have been created by default as in the following code listings, but for the sake of completeness, I have included it here too.

As a standard naming convention, the name Startup is used for this file. In reality, though, you can call it whatever you like. Just be sure to rename it in the Program.cs file too.

The following using statements should be included in the Startup.cs file:

using Microsoft.AspNetCore.Builder; 
using Microsoft.AspNetCore.Hosting; 
using Microsoft.Extensions.Configuration; 
using Microsoft.Extensions.DependencyInjection; 

The code contained in the Startup file will be the same for you and is generated by default when creating ...

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.