xml comments - C# XML Documentation of methods in Abstract classes -
i have generic abstract base class has methods on it. methods have xml comments on them such:
/// <summary> /// controller working instances of {tmodel} /// </summary> public abstract class basecontroller<tmodel> : apicontroller { /// <summary> /// creates {tmodel}. /// </summary> [httppost] public task<tmodel> post([frombody] tmodel model) { ... return ... } }
i able implement such:
/// <summary> /// controller working instances of personmodel /// </summary> public class personcontroller : basecontroller<personmodel> { }
and have xml comments generated personcontroller mimic comments on base class. allow fancy https://github.com/domaindrivendev/swashbuckle pick xml comments , display them nicely personcontroller.
currently comments come out follows:
<?xml version="1.0"?> <doc> <assembly> <name>mylibrary</name> </assembly> <members> <member name="t:mylibrary.personcontroller"> <summary> controller working instances of personmodel </summary> </member> <member name="t:mylibrary.basecontroller`1"> <summary> controller working instances of {tmodel} </summary> </member> <member name="m:mylibrary.basecontroller`1.post(`0)"> <summary> creates {tmodel}. </summary> </member> </members> </doc>
i include method documentation post method on personcontroller, too:
... <member name="m:mylibrary.personcontroller.post(`0)"> <summary> creates personmodel. </summary> </member> ...
at point, feel i've wasted time trying figure out how make want. can of me find shortcut?
Comments
Post a Comment