With this code:
bool dataToAdd;
if (null == _priceComplianceDetailList) return dataToAdd;
I was getting a compiler error, "Use of unassigned local variable 'dataToAdd'"
So I had to explicitly assign "false" to the bool:
bool dataToAdd = false;
if (null == _priceComplianceDetailList) return dataToAdd;
In context:
private bool PopulateSheetWithDetailData()
{
bool dataToAdd = false;
if (null == _priceComplianceDetailList) return dataToAdd;
List<PriceComplianceDetail> _sortedDetailList =
. . .
return _sortedDetailList.Count > 0;
}
Why is it necessary? Don't bools have a default value of false?