Hong Hong - 27 days ago 7
C# Question

How to comment properties of a class for Visual Studio intellisense?

I know using /// to comment a function is the right way, and it also works for properties as shown by the following code

/// <summary>
/// This is for demo
/// </summary>
public class Foo
/// <summary>
/// Description A (working for intellisense)
/// </summary>
public int iA { get; set; }

/// Description B (not working for intellisense)
public int iB { get; set; }

public int iC { get; set; }

enter image description here

I am wondering if there is a simpler way to comment class properties for intellisense than the /// which is 3 lines minimum.

ken ken
Answer Source

It's just XML. You can do it in one line if you want to.

/// <summary>Description A (working for intellisense)</summary>
public int iA { get; set; }