A custom attribute class is named ValidatedAttribute. How can it be applied to a method in C#?
Correct answer B. [Validated] or [ValidatedAttribute]
Explanation
By convention attribute class names end in Attribute, and C# lets you omit that suffix when applying them, so [Validated] and [ValidatedAttribute] both refer to the same class. The class must derive from System.Attribute, and AttributeUsage can restrict where it is allowed. @Validated is Java annotation syntax and # introduces preprocessor directives.
Answer checked How we write and check questions
Discussion