Search code examples
c#syntax.net-attributes

what are ["foo bar"] lines in c#?


So I'm coming over from Java, and I've been seeing (and using), a ton of these:

["foo bar"]
void method(param params)
{
     ..code things
}

Can someone explain to me what they are? I don't even know what they're called, so I can't manage to figure it out from documentation.


Solution

  • They are called .NET Attributes. You can read about it for example here: What are attributes in .NET?