DEV Community

loading...

.NET Tuples

Joe Enos
Software developer/architect, mostly working with .NET and SQL Server.
・1 min read

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:

Discussion (0)

Forem Open with the Forem app