C# XML /// Comments, where does <returns></returns> tag show up?

Viewed 18011

I am currently a programming student, and obviously my question is simple, but I haven't been able to find the answer to it online. So here it is:

In XML /// comments in C#, where does the <returns> tag show up, I know that everything contained in the <summary> tag shows up in intellisense when you hover your mouse over your method call, but not the returns tag.

So where does the <returns> tag come in?

Thanks.

5 Answers

For those that may come trying to find something. This might not be the best approach but IMHO it does make more understandable what a method does while hovering over the method name.

        /// <summary>
        /// Adds a new post given the mapped PostDTO and userId <br></br><br></br>
        /// <b>Returns</b> the newly created object, otherwise null.
        /// </summary>
        /// <param name="postDTO"></param>
        /// <param name="userId"></param>
        PostDTO addPost(PostDTO postDTO, long userId);

This way you can see something in VS (at least in VS 2019) like in next image, which in my experience, when trying to understand code made by others, at least you can tell what to expect, whether an actual object or null, or whatever scenario.

enter image description here

I hope it may be useful for others.

Related