public ResultDto Delete(int ahid, int userId) { ResultDto resultDto = new ResultDto(); string obectName = "AccountHead"; try { ObjectParameter prmResultID = new ObjectParameter("Result", resultDto.Result); ObjectParameter prmMessage = new ObjectParameter("Message", string.Empty); _dbContext.uspAccountHeadDiscard(ahid, userId, prmResultID, prmMessage); resultDto.Result = (bool)prmResultID.Value; resultDto.Message = (string)prmMessage.Value; resultDto.ObjectId = (int)ahid; } catch (Exception) { resultDto.Message = string.Format("Service layer error occured while deleting the {0} details", obectName); resultDto.ObjectId = -98; } return(resultDto); }