int expenseCode;
if (int.TryParse(sourceRecord.ExpenseCode, out expenseCode) && _ExpenseCodeLookup.ContainsKey(expenseCode))
{
destRow.PROFIT_CENTER_NAME = _ExpenseCodeLookup[expenseCode];
}
else
destRow.PROFIT_CENTER_NAME = "Unknown";
The thing I am conerned about is will the first expression always be run (setting expenseCode
in the process) before the second operation?