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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -