/// /// ///

How to refer to class properties in XML docs C#?

38 Views Asked by At

Suppose I have a method in a class

public class MyClass{
   public int MyInt;

   /// <summary>
   /// Prints out the value of <paramref name="MyInt">
   /// </summary>
   public void PrintValueOfMyInt()
   {
     ...
   }
}

Is this the correct way to refer to the MyInt member in the XML doc above PrintValueOfMyInt? If not, how to do it?

1

There are 1 best solutions below

0
anaotha On BEST ANSWER

A solution is to use <see cref="MyInt"/>, so in total we get:

/// <summary>
/// Prints out the value of <see cref="MyInt"/>
/// </summary>
public void PrintValueOfMyInt()
{
  ...
}