<inheritdoc> (C# Programming Guide)

Syntax

<inheritdoc/> 

InheritDoc

Inherit XML comments from base classes, interfaces, and similar methods. This eliminates unwanted copying and pasting of duplicate XML comments and automatically keeps XML comments synchronized.

Remarks

Add your XML comments in base classes or interfaces and let InheritDoc copy the comments to implementing classes.

Add your XML comments to your synchronous methods and let InheritDoc copy the comments to your asynchronous versions of the same methods.

If you want to copy the comments from a specific member you can use the cref attribute to specify the member.

Examples

// compile with: -doc:DocFileName.xml 

/// <summary>
/// You may have some primary information about this class.
/// </summary>
public class MainClass
{
}

///<inheritdoc/>
public class TestClass: MainClass
{
}
// compile with: -doc:DocFileName.xml 

/// <summary>
/// You may have some primary information about this interface.
/// </summary>
public interface ITestInterface
{
}

///<inheritdoc cref="ITestInterface"/>
public class TestClass : ITestInterface
{
}

See also