【问题标题】:How Can I add comment for my interface? (XML Documention)如何为我的界面添加评论? (XML 文档)
【发布时间】:2016-04-17 08:15:45
【问题描述】:

我有一个界面如下:

  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(); 

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

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

【问题讨论】:

    标签: c# xml generics interface documentation


    【解决方案1】:

    恐怕无法实现您想要的。事实上,您的代码文档应该描述它在非技术热词中的作用。尽量让你的评论足够笼统。

    您可以使用&lt;typeparamref name="T" /&gt;&lt;see cref="{T}" /&gt;,但Visual Studio 只会将其称为T

    这些都不能真正解决你的问题,很抱歉。

    相关post.

    【讨论】:

      猜你喜欢
      • 2021-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-31
      • 1970-01-01
      • 2014-07-06
      • 2012-07-12
      • 2016-10-13
      相关资源
      最近更新 更多