I am having below code and wondering why else part is unreachable as per resharper.
private bool SomeMEthod(some parameter)
{
bool status = false;
var someCollection = _entity.CustomerPaymentStatus.Where(record => record.CustomerPaymentId == paymentId && record.CurrentRecord == true);
if (someCollection != null)
{
var receivedPayment = someCollection.FirstOrDefault();
/*some code to save data into DB*/
status = true;
}
else
{
//Some code here to log failure scenario
//here Resharper giving me warning
//code is heuristically unreachable
}
return status;
}
I have checked couple of post but not clear like Code is heuristically unreachable
Any Thought please.