C
C#15mo 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
Thinker15mo ago
/// <inheritdoc cref="A"/>
/// <inheritdoc cref="A"/>
I think
Pobiega
Pobiega15mo ago
^
Developful
DevelopfulOP15mo ago
that works, tysm
Pobiega
Pobiega15mo ago
Thinker nailed it
Azrael
Azrael15mo ago
Is cref="ref" necessary? What happens if you don't include it?
Thinker
Thinker15mo ago
cref="ref" indicates what to inherit the doc from
Azrael
Azrael15mo ago
I know. But is it necessary?
Thinker
Thinker15mo ago
If you want to inherit the doc from something which isn't the parent class, yes
Azrael
Azrael15mo ago
Alright.
Coehl
Coehl15mo ago
Or if it's a class with one interface and no parent, it can inherit from that without it
Accord
Accord15mo 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.
Want results from more Discord servers?
Add your server