38

これにコメントする適切な方法は何ですか?

/// <summary>
/// Initializes a new instance of the <see cref="Repository"/> class.
/// </summary>
/// <param name="unitOfWork">The unit of work.</param>
public Repository(IUnitOfWork unitOfWork)
{
    this.UnitOfWork = unitOfWork;
}

VSはそれについて不平を言います:

警告 11 'Data.Repository.Repository(Data.IUnitOfWork)' の XML コメントには、解決できなかった cref 属性 'Repository' があります C:\Projects\xx\yy\DataAccess\Repository.cs 35 58 データ

4

2 に答える 2

49

中括弧を使用する必要があります。

/// <summary>
/// Initializes a new instance of the <see cref="Repository{T}"/> class.
/// </summary>

ごとtypeparamに、カンマで区切られた中かっこに追加の値を追加するだけです。

于 2011-07-29T03:00:31.417 に答える
4

StyleCop は、どのように見えるべきかを定義しています。

クラスに汎用パラメータが含まれている場合、次の 2 つの形式のいずれかを使用して、cref リンク内でこれらに注釈を付けることができます。

/// <summary>
/// Initializes a new instance of the <see cref="Customer`1"/> class.
/// </summary>
public Customer()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="Customer{T}"/> class.
/// </summary>
public Customer()
{
}
于 2018-03-13T11:11:47.687 に答える