What is the method keyword used in C #?

This may be a silly question or oversight on my part, but .. If you enter a "method" inside the attribute definition, as shown below:

[method: ]
public class MyClass 

Visual Studio highlights the keyword. It doesn't seem to highlight it outside the attribute, as far as I can tell, and pressing F1 in VS loads you at 404.

I have never seen this really used, and I cannot find any information about it.

Does anyone know what he is doing?

+5
source share
2 answers

See Inevitable Attribute Targets (C # Programming Guide) .

Basically, this is to eliminate the ambiguity between the attribute applied to the method and the attribute applied to the return value.

+6

, , method, . , , DLL . module assembly.

+1

All Articles