Chapter 11. Composition using tuples
- Using tuples to compose data
- Tuple syntax: literals and types
- Converting tuples
- How tuples are represented in the CLR
- Alternatives to tuples and guidelines for their use
Back in C# 3, LINQ revolutionized how we write code to handle collections of data. One of the ways it did that was to allow us to express many operations in terms of how we want to handle each individual item: how to transform an item from one representation to another, or how to filter items out of the result, or how to sort the collection based on a particular aspect of each item. For all that, LINQ didn’t give us many new tools for working with noncollections.
Anonymous types provide one kind ...
Get C# in Depth, Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.