What is a C# Tuple?

C# tuples are a Gotcha! programming interview question because their use is so rare and so wrapped in mystery that it's a good test of your knowledge of the C# language. Back in Dotnet 4.0, tuples were of limited value. You could only have eight items in a tuple, they were immutable and you accessed them through a funky syntax. Today with the advent of the value tuple, modern Dotnet tuples can act as lightweight "backpacks" for multiple datatypes and they are especially useful if you have to return multiple values from an asynchronous method. The code for this is available at: https://github.com/mcbethr/WhatIsACSharpTuple or www.ryanmcbeth.com


Featured Posts
Posts are coming soon
Stay tuned...
Recent Posts
Archive
Search By Tags
No tags yet.
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square