API Development with ASP.NET Flashcards
What do we mean by scaffolding a controller? What files are added to the project?
You add scaffolding to your project when you want to quickly add code that interacts with data models. A new controller class is added
What does ASP stand for and how long has it been around? What makes it active?
Active Server Pages, it has been around for 20 years (released since 2002). It’s active due to dynamically producing web pages.
How does the structure of an ASP.NET application relate to MVC?
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
What actions happen on startup of an ASP.NET application?
Services required by the app are configured. The app’s request handling pipeline is defined as a series of middleware components.
What are the responsibilities of a dependency injection container?
To remove this dependency by separating the usage from the creation of the object.
What are the 3 classes of service lifetimes? What do they mean?
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
What happens in the request pipeline?
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.
Name some components of the request pipeline?
Exception handler HSTS HttpsRedirection Static Files Routing CORS Authentication Authorization Endpoint