Deprecation using ObsoleteAttribute in C#
In C#, there’s an ObsoleteAttribute marker for elements that you want to deprecate.
When you mark something with ObsoleteAttribute, accessing it shows a compiler warning, and calling it produces a compiler error. You can define a custom message to explain why it’s obsolete and to suggest an alternative.
Helpful: .NET docs