Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the recommended way to create xml documentation for a Func property

What is the recommended way to document the parameters and return of a Func property on a class in c# e.g.

public class Test
{
    /// <summary>
    /// A description of what AFunc is for.
    /// </summary>
    /// <remarks>
    /// Should I document the parameters and return here or somewhere else?
    /// </remarks>
    public Func<object, string[], bool> AFunc { get; set; }
}

Intellisense in Visual Studio 2010 doesn't offer the param or return tags on a property like it does for methods; would those still be the most appropriate tags to use though?

Edit:

Since asking this I've spotted in some of the xml-documentation on msdn that any valid xml can be used to tag, so my thinking now is more so to either simply use the param and return tags; or to use custom tags and decide on appropriate naming?

like image 911
Alternator Avatar asked Jan 01 '26 19:01

Alternator


1 Answers

Rather than depending on code documentation, I'd recommend starting with making your code more "end developer" friendly. Consider changing the return type to a friendly-named delegate.

http://msdn.microsoft.com/en-us/library/ms173171(v=vs.100).aspx

To start with, that will make your code more self explanatory. You can then use code documentation to explain the purpose of the returned value rather than trying to explain the type of returned value.

like image 102
Paul Fleming Avatar answered Jan 03 '26 12:01

Paul Fleming



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!