Oskar Kjellin
Oskar Kjellin

Reputation: 21900

Share XML documentation across overloads

Is there a way to share XML documentation of the parameters to all the overloads? Let's say I have 10 overloads of a method but they all share the first 5 parameters (I use C# so I cannot have optional parameters).

How do I do it so that I do not have to write the same text for all of the parameters?

Upvotes: 1

Views: 239

Answers (2)

erendrake
erendrake

Reputation: 31

This doesn't really answer your question, but I find that when I get more than 5-8 overloads, it is simpler to provide a simple POCO with every possible argument.

This gives me a place to embed validation and add as many properties as I like at a later date, and it's a single place to add xml docs.

Upvotes: 1

David
David

Reputation: 34563

You can't. The task could be automated but the same text will have to be there for the compiler.

Upvotes: 0

Related Questions