extension-methodsmaml

Documenting extension methods with MAML


When I refer to a method in my docs, I write something like this: M:MyClass.MyMethod(System.String)

How do I do the same if I need to refer to an extension method?


Solution

  • I believe mjd79 is correct in that you'd refer, or link, to the extension methods using same syntax as for normal methods.

    Not sure what tool you are using to compile the docs, but the Sandcastle Help File Builder will automatically find and generate an "Extensions" section for any class that has available extension methods at the time of compile.

    I realize this only helpful for documenting extensions for class that you own. When creating extensions for external classes, you do not have many options other than including a blurb in the extension method summary to indicate that the method is intended as an extension method

    Attached is a screenshot from some documentation I was playing around with, but you can see the Extensions section: Sandcastle documentation example