I want to use Tuples in my code dynamically and have to assign the values to tuple according to the if statement. I have the following code:
if(check != null)
var scoreTmpTuple = new Tuple<Guid, string, double>(
(Guid)row["sampleGuid"],
Convert.ToString(row["sampleName"]),
Convert.ToDouble(row["sampleScore"]));
else
var scoreTmpTuple = new Tuple<Guid, string, double>(
(Guid)row["exampleGuid"],
Convert.ToString(row["exampleName"]),
Convert.ToDouble(row["exampleScore"]));
In the code, the tuple is declared inside the if and else statements. I want to declare that outside and initialize the tuple accordingly.