December 2019
Intermediate to advanced
510 pages
11h 33m
English
As we mentioned previously, another critical part of our APIs is the response model. The response model classes act as filters between the domain model and the client. For example, let's think about a particular field in our domain model that, for whatever reason, must not be part of our response. Response models help us deal with cases such as these.
Let's suppose that we need to implement a soft-delete in our APIs. As we mentioned earlier, a soft-delete is a way to mark a record for the deletion or to temporarily prevent it from being selected. To perform a soft-delete on MemoryOrderRepository, we should add an IsInactive flag, which marks the target record as deleted:
public class Order{ public Guid Id {Read now
Unlock full access