Tuples in C# PRO

Tuples were introduced in .NET 4.0. While arrays hold objects of the same type, tuples can hold objects of different types. The eight different generic Tuple classes are available for the purposes of having tuples with diferent number of types. Once a tuple was created the type of its fields cannot be changed. In a way, using a tuple is similar to using a value type.

The .NET 4.0 includes eight different generic Tuple classes and one static Tuple class that works as a factory for getting tuples. Calling the Tuple.Create() static method we can get a new tuple.

The following video clips explain various aspects related to using tuples in our code. I have just completed to update my C# Fundamentals course at www.abelski.com. You can get the source code as well as more training material about tuples in C# at www.abelski.com.

Share:

The Visitor Design Pattern

The Visitor Design Pattern

The visitor design pattern allows us to add operations to objects that already exist without modifying their classes and without extending them.

What are Anti Patterns?

Anti Patterns

Unlike design patterns, anti patterns just seem to be a solution. However, they are not a solution and they cause additional costs.

Virtual Threads in Java Professional Seminar

Virtual Threads in Java

The use of virtual threads can assist us with improving the performance of our code. Learn how to use virtual threads effectively.

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences