有人可以帮我确定这种不明语法的目的是什么。这是该对象的构造函数中的一个额外的小东西。我想弄清楚类声明行末尾的“<IdT>”是什么?我认为这是我觉得有用的东西,我只需要了解为什么这么多人似乎这样做。
using BasicSample.Core.Utils;
namespace BasicSample.Core.Domain
{
/// <summary>
/// For a discussion of this object, see
/// http://devlicio.us/blogs/billy_mccafferty/archive/2007/04/25/using-equals-gethashcode-effectively.aspx
/// </summary>
public abstract class DomainObject<IdT>
{
/// <summary>
/// ID may be of type string, int, custom type, etc.
/// Setter is protected to allow unit tests to set this property via reflection and to allow
/// domain objects more flexibility in setting this for those objects with assigned IDs.
/// </summary>
public IdT ID {
get { return id; }
protected set { id = value; }
}