Chandrakant Patil

Chandrakant Patil

  • 1.4k
  • 383
  • 68.7k

Need Suggestions to Refactor Code

Apr 15 2019 7:49 AM
Today I have just seen the code which I wrote 3 Years ago, Using I think Visual Studio 2008.
I am surprised how Visual Studio has become Intelligent.
It's showing me some fixes, as Unreachable code detected (return false)
 
public bool ADD(BankBEL objBankMasterBEL)
{
bool result = false;
BankDAL objDAL = new BankDAL();
if (objDAL.IsRecordExist(objBankMasterBEL))
{
throw new Exception("This name already exists..");
return false;
}
result = objDAL.ADD_BANKMASTER(objBankMasterBEL);
return result;
}

Answers (1)