What is the [ and ] in c#? what is it used for? what does it mean?
example
[DefaultValue(null)]
[JsonName("name")]
public string Name
{
get
{
if (this.name == null)
{
return String.Empty;
}
return this.name;
}
}
That is an Attribute. By themselves they do nothing at all, they just decorate code. But code can discover attributes and react to them at runtime.