How do I mark a method as Obsolete/Deprecated using C#?
The shortest way is adding a Method Attribute:
You can add an explanation:
[Obsolete("Method1 is deprecated, please use Method2 instead.")]
You can also cause the compilation to fail (treat method use as error instead of warning) if the method is called from somewhere in code like this:
[Obsolete("Method1 is deprecated, please use Method2 instead.", true)]