Aaron Cronje

Aaron Cronje

  • NA
  • 256
  • 262.7k

Attributes in c#

Dec 17 2011 11:22 PM
Hi........

               I am doing a work in c# and define Attributes. How can we use attributes in c# and define its properties?

class BasicAttributeDemo
{
    [Obsolete]
    public void MyFirstdeprecatedMethod()
    {
        Console.WriteLine("Called MyFirstdeprecatedMethod().");
    }

    [ObsoleteAttribute]
    public void MySecondDeprecatedMethod()
    {
        Console.WriteLine("Called MySecondDeprecatedMethod().");
    }
In this code define [Obsolete ] what is the meaning of this variable? 


Answers (2)