摘要:
让Dictionary key 支持自定义对象,则对象必须继承IEquatable,重写GetHashCode、Equalsclass Foo : IEquatable<Foo> { public string Name { get; set;} public int FooID {get; set;} public override int GetHashCode() { return Name.GetHashCode()+FooID.GetHashCode(); } public override bool Equals(object obj) { return Eq... 阅读全文
posted @ 2012-06-04 19:58
94cool
阅读(255)
评论(0)
推荐(0)
浙公网安备 33010602011771号