1. What is MVC and it's cycle?
MVC application life cycle has two main phases first creating the request object and second sending our response to the browser.
1. Creating Response Object:
The request object creation has major four steps as below:.
- Fill route:- MVC requests are mapped to route tables which in turn specify which controller and action to be invoked. So if the request is the first request the first thing is to fill the route table with routes collection. This filling of route table happens in the global.asax file.
- Fetch route:- Depending on the URL sent "UrlRoutingModule" searches the route table to create "RouteData" object which has the details of which controller and action to invoke.
- Request context created:- The "RouteData" object is used to create the "RequestContext" object.
- Controller instance created:- This request object is sent to "MvcHandler" instance to create the controller class instance. Once the controller class object is created it calls the "Execute" method of the controller class.
2. Creating Response object:
This phase has two steps executing the action and finally sending the response as a result to the view.
- Execute Action:- The "ControllerActionInvoker" determines which action to executed and executes the action.
- Result sent:- The action method executes and creates the type of result which can be a view result , file result , JSON result etc.
So in all there are six broad steps which get executed in MVC application life cycle.
2. What is Appsettings.json ?
appsettings.json is one of the several ways, in which we can provide the configuration values to ASP.NET core application. You will find this file in the root folder of our project.
We can also create environment-specific files like appsettings.customer.json, appsettngs.production.json, etc.
3. What is the importance of wwwroot ?
Having a wwwroot folder keeps a clean separation between code files and static files. It brings clarity to the items that will be sent to the server and the items that should remain on the dev machine.
1 comments:
Hello sir jii
Post a Comment