Referring to a generic type of a generic type in C# XML documentation?

后端 未结 5 1568
情歌与酒
情歌与酒 2021-02-06 21:31

Writing some XML documentation for a predicate helper class. But I can\'t figure out I can refer to an Expression> without getting a synta

5条回答
  •  别那么骄傲
    2021-02-06 21:59

    There seems to be no way to refer to a generic of a generic in XML documentation, because actually, there's no way to refer to a generic of any specific type.

    Lasse V Karlsen's answer made it click for me:

    If you write , the compiler just uses "Int32" as the type parameter name, not the type argument. Writing would work just as well. This makes sense because there is no specific page in MSDN for "IEnumerable of int" that your documentation could link to.

    To document your class properly, I think you'd have to write something like:

    
    Returns an  of  
    of , .
    
    

    I hope you like text.

提交回复
热议问题