C
C#2y ago
Developful

❔ Getting documentation from another class and putting it in another one

Title is probably very confusing, but I'm asking if theres a way to do this
/// <summary>
/// This is Class A;
/// </summary>
class A { }

/// grab Class A's documentation
class B { }
/// <summary>
/// This is Class A;
/// </summary>
class A { }

/// grab Class A's documentation
class B { }
so basically if i hover over B, it'll show me A's documentation i also don't wanna copy paste in case I make changes to A's documentation
11 Replies
Thinker
Thinker2y ago
/// <inheritdoc cref="A"/>
/// <inheritdoc cref="A"/>
I think
Pobiega
Pobiega2y ago
^
Developful
DevelopfulOP2y ago
that works, tysm
Pobiega
Pobiega2y ago
Thinker nailed it
Azrael
Azrael2y ago
Is cref="ref" necessary? What happens if you don't include it?
Thinker
Thinker2y ago
cref="ref" indicates what to inherit the doc from
Azrael
Azrael2y ago
I know. But is it necessary?
Thinker
Thinker2y ago
If you want to inherit the doc from something which isn't the parent class, yes
Azrael
Azrael2y ago
Alright.
Coehl
Coehl2y ago
Or if it's a class with one interface and no parent, it can inherit from that without it
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?