What's the proper way to comment a constructor in a generic class?

mservidio picture mservidio · Jul 29, 2011 · Viewed 19.3k times · Source

What's the proper way to comment this?

/// <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 complains about it:

Warning 11 XML comment on 'Data.Repository.Repository(Data.IUnitOfWork)' has cref attribute 'Repository' that could not be resolved C:\Projects\xx\yy\DataAccess\Repository.cs 35 58 Data

Answer

AnteSim picture AnteSim · Jul 29, 2011

You need to use curly braces:

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

For each typeparam, just add an additional value in the braces, delimited with a comma.