call the current method, using some sort of keyword? for self reference


Is there anyway i can call the current method from inside without typing the method name again (incase the method name is changed by someone else later)

So currently, i call the same name internally (SelfRef), this will cause a bug in future maintenance if not using a code auditing program


void SelfRef(string _Input){
		if (_Input == "route1"){
			//route1 calls route 2
			SelfRef("route2"); //call self
		}else if (_Input == "route2"){
			//route2 ends

Hi there

I’m afraid there isn’t that functionality as far as I know, though it’s possible I’ve just not found it!

I would point out though that unless somebody changes the method name AND creates a new method with the original name, it’ll just create an easily fixable compiler error - no need for using code auditing software or anything.