APIs/Data Models (18%) Flashcards
True or False. Most of the time, mappers do not apply business logic?
True
Which requests may contain a query string and a body ?
POST, PUT and PATCH
From a payload, which kind of object is constructed and passed to the controller?
An API Model object
Name the 2 attributes that are used to determine which URL an endpoint will respond to?
RoutePrefix
Route
Which method is declared in the BaseApiController class and is responsible for the whole controller flow?
The ExecuteAsync method
What is the ExecuteAsync method?
It is a simple async wrapper around the synchronous Execute method
What is the responsibility of the Execute method from the BaseApiController class?
The Execute method is responsible for the whole API call flow.
It interacts with the mapper and the service to apply the business logic
Name the 4 steps done by the Execute method of the BaseApiController class
Map the API parameter to Service parameter
Call the service with the Service parameter
Map the Service Result back to an API result
Send back the API Result in the response
Which are the 3 common strategies adopted when developing custom API endpoints?
Simple service + controller (simple method)
Simple service + ExecuteAsync (hybrid method)
Service + Handler Chain (advanced method)
The ExecuteAsync method takes 5 generic types as parameters. Name them, in the correct order.
Mapper API Parameter Service Parameter Service Result API Result
Which Object Relational Model (ORM) B2B Commerce uses?
B2B Commerce uses Entity Framework Code First version 6
Where is the the ODataControllers.tt T4 template located?
In the Insite.Admin library
Is it possible for developers to extend the existing T4 template?
No. I t is recommended to implement a custom T4 template independently. Developers cannot extend the existing T4 template.
Describe 2 ways entities can be archived?
Setting the DateTime deactivate property to today’s date.
Setting the Boolean archive property to false.
How is it possible for a developers to retrieve archived entities?
Using the Admin API developers can retrieve archived entities by appending the archivedFilter=1 OData query