2. Getting Started Flashcards

1
Q

What happens, when you start without debugging?

A

Visual Studio will compile and start the example application and then open a new browser window to send the application an HTTP request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the launch.json file contain?

A

the startup settings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are endpoints and how do they work?

A

In an ASP.NET Core application, incoming requests are handled by endpoints. The endpoint that produced the response in Figure 2-17 is an action, which is a method that is written in C#. An action is defined in a controller, which is a C# class that is derived from the Microsoft.AspNetCore.Mvc.Controller class, the built-in controller base class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Understanding routes?

A

The ASP.NET Core routing system is responsible for selecting the endpoint that will handle an HTTP request. A route is a rule that is used to decide how a request is handled. When the project was created, a default rule was created to get started. You can request any of the following URLs, and they will be dispatched to the Index action defined by the Home controller:

•/
•/Home
•/Home/Index
So, when a browser requests http://yoursite/ or http://yoursite/Home, it gets back the output from HomeController’s Index method. You can try this yourself by changing the URL in the browser. At the moment, it will be http://localhost:5000/, except that the port part may be different if you are using Visual Studio. If you append /Home or /Home/Index to the URL and press Return, you will see the same Hello World result from the application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does HTML rendering work?

A

The output from the previous example wasn’t HTML—it was just the string Hello World. To produce an HTML response to a browser request, I need a view, which tells ASP.NET Core how to process the result produced by the Index method into an HTML response that can be sent to the browser.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly