With this code:
bool dataToAdd; if (null == _priceComplianceDetailList) return dataToAdd;
I was getting a compiler error: "Using an unrecognized local variable" dataToAdd "
So I had to explicitly set "false" for bool:
bool dataToAdd = false; if (null == _priceComplianceDetailList) return dataToAdd;
In the context:
private bool PopulateSheetWithDetailData() { bool dataToAdd = false; if (null == _priceComplianceDetailList) return dataToAdd; List<PriceComplianceDetail> _sortedDetailList = . . . return _sortedDetailList.Count > 0; }
Why is this necessary? Do bools not have a default value of false?
source share