liveBook · Manning

Data transfer object

A data transfer object is a data-carrying structure that conveys defined information between software components or across application boundaries without encapsulating substantial domain behavior.

How 6 Manning books explain it

Building Web APIs with ASP.NET Core

A data-transfer object is an object that packages data for transfer between software components or across an interface.

How it is used
Packages board-game API request and response data for exchange as JSON with clients.
How deep it goes
Builds generic response and endpoint-specific input classes, then follows their use through controller actions and validation.
Examples
Uses a linked board-game response, a board-game update request, and account registration and login DTOs.
What you can do after
Build it from scratch for ASP.NET Core endpoints that accept selected inputs or return typed data with descriptive links.

Read how Building Web APIs with ASP.NET Core explains data transfer object →

Secure APIs

A data transfer object is a data structure used to carry structured data between software layers or processes without encapsulating domain behavior.

How it is used
Uses DTOs as a secure implementation pattern for transferring limited data across API, business, database, and other application layers.
How deep it goes
Defines DTOs and their security purpose, but stops short of showing DTO code or a construction procedure.
Examples
Uses API, business, and database layers as the concrete transfer path, with incoming and outgoing payloads as validation boundaries.
What you can do after
Apply DTOs to restrict transferred fields, then validate payloads and test each application layer.

Read how Secure APIs explains data transfer object →

.NET MAUI in Action

A data transfer object is a data structure that carries serialized data between application or service boundaries without encapsulating business behavior.

How it is used
Shares consistent data shapes across application, Web API, and .NET MAUI client projects.
How deep it goes
Defines DTO behavior and contrasts it with ViewModel functionality, but does not detail serialization or transport protocols.
Examples
Uses ProductDto, StockCountDto, InventoryItemDto, User, and aggregated leaderboard data as examples.
What you can do after
Apply it via shared projects to reuse data structures and distinguish data-only DTOs from functional ViewModels.

Read how .NET MAUI in Action explains data transfer object →

.NET in Action, Second Edition

A data transfer object is an object that defines the data communicated across a boundary without necessarily exposing the structure of the underlying domain or persistence model.

How it is used
Structures data crossing application boundaries, especially between web-facing operations and persistence code.
How deep it goes
Defines DTO purpose and implements separate C# records for creation and update, without detailing serialization or validation.
Examples
Uses NewCustomerDto and UpdateCustomerDto in a customer repository called by a CSV importer.
What you can do after
Build it from scratch by defining operation-specific records and passing them through explicit repository methods.

Read how .NET in Action, Second Edition explains data transfer object →

Building Distributed Applications that Work

A data transfer object is a data-only structure that carries selected values across application or service boundaries.

How it is used
Carries product data from an API to a UI without exposing the database entity as the UI’s data type.
How deep it goes
Defines the DTO’s boundary role and shows a C# record and consuming client, but does not detail entity-to-DTO conversion.
Examples
Uses a ProductDto record, a /products HTTP request, and a home-page product table.
What you can do after
Build it from scratch as a C# product record, then use it to receive and display API data.

Read how Building Distributed Applications that Work explains data transfer object →

F# in Action: A Revised Edition of Get Programming with F#

A data transfer object is an object that carries data between software components without encapsulating domain behavior.

How it is used
Separates JSON-facing data from rich domain behavior during deserialization and supports F#’s data-first design.
How deep it goes
Defines simple records, demonstrates raw-to-domain validation, and stops short of embedding domain logic in converters.
Examples
Uses a guitar inventory with RawGuitar fields, JSON input, and tryAsFullGuitar mapping.
What you can do after
Build it from scratch by defining a JSON-shaped record, deserializing into it, and mapping validated values into the domain.

Read how F# in Action: A Revised Edition of Get Programming with F# explains data transfer object →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.