Say, we have that code:
var tuple = new Tuple<double, int>(10.6, 2);
var tupleString = tuple.ToString(); //returns "(10.6, 2)";
Can we get a new Tuple instance from tupleString
without implementing any custom parsers and JsonConverters and extending TypeConverter?
UPDATE 1
In my production code I have SortedList<Tuple<DayOfWeek, double>, double>
. That list is serialized by Json.NET,that converts Dictionary keys by .ToString()
. Then JSON is sent to frontend application. Then frontend application send request with that serialized key to server. I have to convert that key to .NET Tuple, but I don't know how to do that.