C# Syntax Question

In doing some code review I have encountered something I'm not familiar with:

namespace test
{
[I1ActiveReport("/Reports/..., ReportAccess.userAccount, "Description"]
   public class Name : I1ActiveReport
   {
      ...
   }
}

And then again in a different example, inside a property:

protected className I1Parameters
{
[System.Diagnostics.DebuggerStepThrough]
   get
   {
       ...
    }
}

What do those brackets [  ]   do?
LVL 8
pzozulkaAsked:
Who is Participating?
 
käµfm³d 👽Commented:
It's an attribute. Attributes are kind of like meta-programming. They have a variety of uses, and are more of an advanced topic--at least creating them is.
0
 
Fernando SotoRetiredCommented:
Hi pzozulka;

They are attributes associated with a class, property function and so on and during execution can be accessed using reflections. Please see MS Documentation.

Attributes (C# and Visual Basic)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.