小编bel*_*hev的帖子

在比较两个对象时有条件地更改GetHashCode()

我有两个不同的对象列表,并希望根据某些属性的权重获得它们的相似性.最快的方式似乎是实现IEquatable接口,这就是我所做的:

public class CompareEntry : IEquatable<CompareEntry>
{
    public int LeadId { get; set; }
    public int SaleId { get; set; }
    public string Email { get; set; }
    public string PhonePrivate { get; set; }
    public string PhoneMobile { get; set; }
    public string PhoneCompany { get; set; }
    public string FirstName { get; set; }
    public string Name { get; set; }
    public string City { get; set; }
    public string ZipCode { get; set; }
    public string CompanyName …
Run Code Online (Sandbox Code Playgroud)

.net c# comparison performance gethashcode

1
推荐指数
1
解决办法
198
查看次数

标签 统计

.net ×1

c# ×1

comparison ×1

gethashcode ×1

performance ×1