Chapter 4: Data models for APIs, DTOs, and system boundaries

In this chapter

  • 4.1 What is a system boundary?
  • 4.2 Request DTOs: incoming data
  • 4.3 Record DTOs in ASP.NET Core
  • 4.4 System.Text.Json and records
    • Deserializing positional records
    • Constructor-based deserialization
    • JSON names and record properties
  • 4.5 Response DTOs: outgoing data
    • Mapping domain models to response DTOs
  • 4.6 Where validation belongs
    • Data annotations
    • Independent validators
    • A separate type for validated input
    • Choosing an approach
  • 4.7 Separating DTOs and domain models
  • 4.8 Commands and event payloads
    • Command objects
    • Event payloads
  • 4.9 Configuration objects
  • 4.10 Chapter review

This chapter is not available in the free preview. Purchase the book to read the complete edition now.

Buy this book