Interviews2 answers
How do you mark a method obsolete?
2 Answers
declare Obsolete attribute before the method
eg.
[Obsolete]
public void Obsoletedemo()
{}
or
[Obsolete message="Obsoletedemo"]
public void Obsoletedemo()
{}
kajal ranePosted Apr 7, 2019, 2:16 AM EDT
[Obsolete]
public int Foo()
{…}
or
[Obsolete(\”This is a message describing why this method is obsolete\”)]
public int Foo()
{…}
Samir BhogaytaPosted Jun 25, 2016, 12:12 AM EDT
