如何为界面添加评论? (XML文档)

时间:2016-04-17 08:15:45

标签: c# xml generics interface documentation

我有一个如下界面:

  public interface IBaseRepository<T> where T : class
{  
...
}    

更新
我的大多数实体都会实现这个接口。我在为s.th.添加xml文档时感到困惑。如下(在界面中):

            /// <summary>
            /// This method returns All What??????
            /// </summary>
            /// <returns> <see cref= "OutputWithPaging{T}"/> </returns>
     OutputWithPaging<T> GetAll(); 

XML Documentation

哪个Test实现了IBaseRepository。如你所见,我可以看到City作为评论的一部分而不是摘要部分。

        /// <summary>
        /// This method returns All objects of type <see cref="T"/>.
        /// </summary>
        /// <returns><see cref= "OutputWithPaging{T}"/></returns>  

1 个答案:

答案 0 :(得分:2)

我担心无法达到你想要的效果。实际上,您的代码文档应该描述它在非技术方面的作用。尽量让你的评论足够通用。

您可以使用<typeparamref name="T" /><see cref="{T}" />,但是Visual Studio只会将其称为T

这些都没有真正解决你的问题,我很抱歉。

相关post

相关问题