declare Obsolete attribute before the method eg. [Obsolete] public void Obsoletedemo() {} or [Obsolete message="Obsoletedemo"] public void Obsoletedemo() {}
[Obsolete] public int Foo() {…} or [Obsolete(\”This is a message describing why this method is obsolete\”)] public int Foo() {…}