Is there a class existing in .NET Framework 3.5 that would be equivalent to the .NET 4 Tuple?
I would like to use it in order to return several values from a method, rather than create a struct
.
.net-3.5ctuples
Is there a class existing in .NET Framework 3.5 that would be equivalent to the .NET 4 Tuple?
I would like to use it in order to return several values from a method, rather than create a struct
.
Best Answer
No, not in .Net 3.5. But it shouldn't be that hard to create your own.
UPDATE: Moved the static stuff to a static class to allow for type inference. With the update you can write stuff like
var tuple = Tuple.New(5, "hello");
and it will fix the types for you implicitly.