public ActionResult Delete(long Id) { string ErrorMessage = string.Empty; //TODO : Calling Data Layer var IsSuccess = dalProduct.DeleteById(out ErrorMessage, Id); if (IsSuccess) { return(RedirectToAction("GetAll")); } else { ErrorMessage = ErrorClass + " | " + ErrorMessage; throw new Exception(ErrorMessage); } }