API Development with ASP.NET Flashcards

1
Q

What do we mean by scaffolding a controller? What files are added to the project?

A

You add scaffolding to your project when you want to quickly add code that interacts with data models. A new controller class is added

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

What does ASP stand for and how long has it been around? What makes it active?

A

Active Server Pages, it has been around for 20 years (released since 2002). It’s active due to dynamically producing web pages.

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

How does the structure of an ASP.NET application relate to MVC?

A

Model:
All the data and the rules about processing it (classes, DbContext)

View:
The code that generates the response

Controller:
The controllers handles user’s request and returns a response

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

What actions happen on startup of an ASP.NET application?

A

Services required by the app are configured. The app’s request handling pipeline is defined as a series of middleware components.

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

What are the responsibilities of a dependency injection container?

A

To remove this dependency by separating the usage from the creation of the object.

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

What are the 3 classes of service lifetimes? What do they mean?

A

Transient: refers to objects that are always created they are requested

Scoped: created once per client request. The objects of a services with scoped lifetime are same within a request, but are different across different requests.

Singleton: services are created the first time they are requested, or are added to the service container during startup and they remain same for every object or request

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

What happens in the request pipeline?

A

The request goes through a sequence of request delegates, called one after the other which goes back around from the end. If all pass the response is made.

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

Name some components of the request pipeline?

A
Exception handler
HSTS
HttpsRedirection
Static Files
Routing
CORS
Authentication
Authorization
Endpoint
How well did you know this?
1
Not at all
2
3
4
5
Perfectly