December 2019
Intermediate to advanced
510 pages
11h 33m
English
The final step is to implement a controller that can handle the ItemHateoasResponse response model implemented previously. More specifically, we can proceed by creating a new ItemHateoasController class in our Catalog.API project. Note that we are building a new controller for demonstration purposes. An alternative would be to edit the already defined ItemController to return HATEOAS-compliant responses.
The ItemHateoasController class will use the ILinksService interface provided by the RiskFirst.Hateoas namespace to enrich the Links attribute of the ItemHateoasResponse model and return it to our client. Let's proceed by implementing the controller:
using System;using System.Collections.Generic;using ...