A data transfer object (DTO) is a data structure that carries data between application boundaries without containing business behavior. In MVVM, this distinguishes a DTO from a ViewModel, which includes view state and functionality. section 9.3.3
Place DTOs in a shared project when the frontend and backend use the same data shapes. This reduces duplication and makes structural changes visible across the solution. section 8.4.2
Use DTOs to represent problem-area data alongside services:
- Represent products with ProductDto and process them through ProductService. section 9.5.1
- Represent inventory with StockCountDto and InventoryItemDto and process it through InventoryService. section 9.5.1
- Return a view-oriented DTO containing the data needed to render a screen in one API call. section 9.3.3
Figure 8.6 MauiStockTake is a full-stack solution written in C#. Therefore, there is no need to duplicate code as it can be shared across the stack. Code shared across the stack in this way is referred to as cross-cutting concerns.
Use the architecture diagram to see how shared DTO code crosses the application, Web API, and .NET MAUI client. section 8.4.2





