Develop the Mock Service

Develop a mock service for saving data in-memory.

add function

Let’s start with the add feature. We have a list of CustomerDto, and with every new addition, one instance of CustomerDto is added to the list. The singleton pattern using enum is followed for the in-memory database implementation. The identifier field starts with one and increments by one for every new addition.

Get hands-on with 1400+ tech skills courses.