I am just passing a ValueTuple to a function. I want to process the Values within this ValueTuple.
Unfortunately, VS 2017 only allows me to access credit.Item1
. No further Items. So far I had no issues with ValueTuples.
The error in the compiler is:
ValueTuple<(string loanID, decimal y, ...)> does not contain a definition for 'loanID'...
The code is
public void LogCredit(
ValueTuple<(
string loanID,
decimal discount,
decimal interestRate,
decimal realReturn,
decimal term,
int alreadyPayedMonths)>
credit)
{
// not working!
string loanID = credit.loanID;
// this is the only thing i can do:
string loanID = credit.Item1;
// not working either!
decimal realReturn = credit.Item2;
}
Meanwhile, when hovering over credit
I can see it correctly:
Any Suggestions?