Generic Type Reference in XML Code Comment

As I know, in an XML comment for a C # type or method, you can reference a generic type in a tag, for example:

///<see cref="name.space.typename&lt;T&rt;(paramtype)"> 

But I think there was another syntax that was less awkward? Something to get rid of these html entities '<'? I can’t find him right now. Can anyone help?

+49
generics reference c # xml documentation
Feb 17 2018-11-17T00:
source share
2 answers

Here is a nice documentation article: C # XML documentation comments FAQ

The development team decided to improve this by allowing alternative syntax to refer to common types and methods in the document comments. In particular, instead of using open and closed angle brackets, it is permissible to use open and closed curly braces. The above example would become:

 class Program { /// <summary> /// DoSomething takes a <see cref="List{T}"/> /// </summary> void DoSomething(List<int> al) { } } 

So in your case:

 ///<see cref="name.space.typename{T}( paramtype )" /> 

Edit: the link above is broken; shows raw HTML. Leaving the link now. Here are some new links from Microsoft:

+65
Feb 17 '11 at 2:44 p.m.
source share

Use curly braces:

 ///<see cref="name.space.typename{T}(paramtype)"> 
+7
Feb 17 2018-11-17T00:
source share



All Articles