DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Joe Enos
Joe Enos

Posted on

.NET Tuples

The old Tuple class in .NET was pretty awful. Your objects are named Item1 and Item2, which may be fine for tiny use cases, but for anything real, it makes no sense to use them, when you can build a custom class or struct in just a few seconds.

Now there's a feature for Tuples in .NET that doesn't suck. You can assign multiple variables in one line, and do lots of other things.

Here's a video showing some use cases:

Top comments (0)

πŸ€” Did you know?

Β 
✍️ Writing your own article is easy (we even support markdown).