Life Cycle of the ASP.NET Core MVC part of the application?

Life Cycle​​ of the ASP.NET Core MVC part of the application?

When you use the browser to navigate to​​ http://localhost:5000, the HTTP request is passed to the MVC framework, which routes it to the​​ Index​​ action method defined by the​​ Home​​ controller. This action methoduses Entity Framework Core to read the​​ Product​​ data from the SQL Server database using Entity FrameworkCore and uses it as the view model data for the​​ Index.cshtml​​ view.

Razor processes the​​ Index.cshtml​​ view and generates an HTML response for the browser that includes a JSON representation of the​​ Product​​ data from the database,​​ script​​ elements that load the JavaScript files required by the Angular application, and an​​ app-root​​ element to which the Angular application will be applied. The browser follows the URLs in the​​ script​​ element to load the JavaScript files, which are provided by the static files feature of the ASP.NET Core runtime from the​​ wwwroot​​ folder. The JavaScript files are generated automatically from the TypeScript files using webpack, which has been integrated into the ASP.

NET Core request pipeline (and is the reason that it takes the application a while to start up). shows the structure of the ASP.NET Core MVC part of the application.

 

 

The structure of the ASP.NET Core MVC part of the application

The ASP.NET Core MVC part of the application is made up of familiar building blocks. A controller,​​ action method, and Razor view work together with Entity Framework Core to generate responses for HTTP requests. The responses sent to the client contain HTML elements that provide everything the browser​​ needs to run the Angular application, but the ASP.NET Core components do not have any knowledge of the​​ Angular application.

(Visited 41 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *