Tuples is an interesting subject to go back to due to certain peculiar qualities it possess. In this section, we would address some of them. To begin with, however, we will address how to tuples behave during method overloads - a pattern it share with rest of .Net. Consider the following code. public class Foo … Continue reading Evil Code #12: Tuple Parameter – Overloads and Overrides
Tag: Tuple
Evil Code #011 : Tuples
It has been long since I wrote a post in Evil Code series. So here is a short one, using the Tuples which was introduced in C# 7.X. "introduced in C# 7.x" . You must be wondering why I used that phrase. Tuples was there before 7.x right ? Well, the answer is both yes and no. Tuples … Continue reading Evil Code #011 : Tuples
Serializing/Deserializing Dictionaries with Tuple as Key
Sometimes you run into things that might look trivial but it just do not work as expected. One such example is when you attempt to serialize/Deserialize a Dictionary with Tuples as the key. For example The above code would trow an JsonSerializationException when deserializing. But the good part is, the exception tells you exactly what … Continue reading Serializing/Deserializing Dictionaries with Tuple as Key