August 2017
Intermediate to advanced
330 pages
7h 26m
English
ASP.NET Core web apps are, fundamentally, console applications--isn't it surprising to know that? Just like every console app needs Main() to get executed, the .NET Core apps have the Program.cs file that contains the Main() method.
ASP.NET Core is built on top of .NET Core, which is the reason why we have program.cs in the application structure which we just created. Check out this file:
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
namespace MyFirstCoreAPI
{
public class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build();
}
}
You can break down the preceding code ...
Read now
Unlock full access