c# - How to add List type code example in XML comment? -


i have used below xml comment,

    /// <example>      /// example shows how use <see cref="samplecollection"/> property.     /// <code>     /// class testclass      /// {     ///      list<string> collection = new list<string>();     ///      collection.add("column1");     ///      collection.add("column2");     ///      this.samplecollection = collection;     /// }     /// </code>     /// </example>             public list<string> samplecollection     {         get;         set;     } 

but has following warning error,

xml comment on 'samplecollection' has badly formed xml -- 'end tag 'code' not match start tag 'string'.'

because list definition has <string>. considered xml tag.

is there way resolve this?

use cdata block embed raw text within xml:

<![cdata[ list<string> ... ]]> 

Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -