Develop the Mock Service

Develop a mock service for saving data in-memory.

We will not define the management of the Worker object because we have covered it numerous times in the prior chapters. We will only learn how to accomplish the link between two instances of the Worker and the relationship type.

add function

The mock service will be integrated with an in-memory custom database for saving the data, which will be consumed by the mock user interface. We will start with the add functionality. We have a list of WorkerWorkerDto, and with every new entry, one instance of WorkerWorkerDto that has two instances of WorkerDto and the relationship type is added to the list. A Singleton design pattern with the use of enum is computed in the in-memory database.

Get hands-on with 1400+ tech skills courses.