【发布时间】:2015-08-27 12:31:20
【问题描述】:
当我查看代码隐藏时,我看到每个属性和类名都有很多 /// xml cmets,但是这些 cmets 是如何生成的?
自动?通过第三方?我不认为我的前同事为每个属性和类都输入///....
生成的自动方式(工具/快捷键/其他)是什么?
public interface IRepository<TEntity> where TEntity : class
{
/// <summary>
/// Gets the list of items from the repository
/// </summary>
/// <returns></returns>
IEnumerable<TEntity> Get();
/// <summary>
/// Gets the single entity from the repository
/// </summary>
/// <param name="id">Id of the entity</param>
/// <returns></returns>
TEntity Get(Int32 id);
/// <summary>
/// Adds an entity to the repository
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
TEntity Add(TEntity entity);
/// <summary>
/// Updates an entity in the repository
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
Int32 Update(TEntity entity);
}
【问题讨论】:
-
听起来你最好的选择是问问你的前同事。也许是 GhostDoc?
-
它在我看来确实像 GhostDoc。它确实尝试自己计算出 cmets,但屡屡失败。我让 ghost doc 生成 cmets,然后如果它们需要扩展或没有意义,我自己修改它们。
标签: c# .net visual-studio