aspdotnet_core_hosting_inside_console.md - brainchildservices/curriculum GitHub Wiki

SLIDE-1

STARTING ASPDOTNET CORE HOSTING INSIDE CONSOLE

In aspdotnet core application program.cs is one of the most important file. Program.cs is the file where the hosting of aspdotnet core application is getting started.

image

Line 16 in Main method is the actual code needed to host any aspdotnet core application. Without that line of code, no hosting can be done.

image

SLIDE-2

image

With a breakpoint in line 16 while debugging , will hit in line 16 first.

After line 16 , flow will get in to the CreateHostBuilder method. Then line 23 will access the Startup file, where all services and middleware is got accessed.

image

SLIDE-2(DOWNWARDS)

In Startup.cs file ConfigureServices used to access needed services for the application. Here in a simple aspdotnet core application, Razorpages got accessed by the Line 26 inside ConfigureServices method to get Razorpages in that application.

image

details included in Doc: https://docs.google.com/document/d/10HsxrCSd-vGXThct0QfaglxKQ0Rq-4lmd2R0ntL5JD8/edit?usp=sharing