Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to place the code example in the XML comment?

I have a XML comment like that.

/// <summary>
/// Lorem ipsum
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>

I'd like to place inside it a piece of the (multiline) code. How can I do that ?

Edit

Here's the info about multiline code Adding line breaks to comments for Intellisense

like image 400
Tony Avatar asked Sep 06 '12 16:09

Tony


People also ask

What is the use of comments in XML explain with an code?

An XML comment encountered outside the document type declaration is represented by the Comment value syntax element. It contains the comment text from the XML message. If the value of the element contains the character sequence --> , the sequence is replaced with the text --&gt; .

How do you comment multiple lines in POM XML?

Commenting out an entire XML block using CTRL+ / comments each line separately instead of creating a block comment. Select the entire block of xml and hit CTRL+/ to comment the entire block.

How do I add comments to XML in Visual Studio?

To insert XML comments for a code element Do one of the following: Type /// in C#, or ''' in Visual Basic. From the Edit menu, choose IntelliSense > Insert Comment. From the right-click or context menu on or just above the code element, choose Snippet > Insert Comment.


1 Answers

You can use <code> and <c> XML tags

/// <summary>
/// ...
/// <c>Place your code here</c>
/// </summary>
/// <code>
/// More code here
/// </code>

Per comment, in the <summary> you can use a <c> tag and outside <summary> you can use a <code> tag.

like image 84
oleksii Avatar answered Sep 29 '22 08:09

oleksii