If my class has a commented public property, which is assigned via constructor, can I reference its description from a description of constructor argument with the same name?
public class MyClass
{
/// <summary>
/// x description
/// </summary>
public int x { get; private set; }
/// <summary>
/// y description
/// </summary>
public int y { get; private set; }
/// <summary>
/// Constructor description
/// </summary>
/// <param name="x">How do I reference x description from here?</param>
/// <param name="y">And y description?</param>
public MyClass(int x, int y)
{
this.x = x;
this.y = y;
}
}
You can't include the description, but you can link to the property documentation with the <see>
tag. For example:
<param name="x">The initial value for <see cref="x"/></param>
As an aside, I would strongly urge you to follow .NET naming conventions, where public members start with capital letters.
See more on this question at Stackoverflow