Compiler Support Tags : Documentation Comments « Language Basics « C# / CSharp Tutorial






using System;

namespace Payroll
{
    
    /// <summary> 
    /// Document for Employee class
    /// See a cross reference <see cref="String">string</see>
    /// </summary>
    public class Employee
    {
        /// <summary>
        /// Comment for the constructor
        /// <paramref name="name">name2</paramref> is a string.
        /// </summary>
        /// <param name="id">Employee id number</param>
        /// <param name="name">Employee Name</param>
        public Employee(int id, string name)
        {
            this.id = id;
            this.name = name;
        }
        
        /// <summary>
        /// Comments for another constructor
        /// </summary>
        /// <remarks>
        /// <seealso cref="Employee(int, string)">Employee(int, string)</seealso>
        /// </remarks>
        public Employee()
        {
            id = -1;
            name = null;
        }
        int id;
        string name;
    }
}








1.2.Documentation Comments
1.2.1.Documentation Comments for class
1.2.2.Documentation Comments for A member variable
1.2.3.Documentation Comments for A property
1.2.4.Documentation Comments for a method with parameters
1.2.5.Documentation Comments for Main function
1.2.6.Compiler Support Tags
1.2.7.XML Documentation
1.2.8.Recommended Code Comment XML Elements