Files
codeql/csharp/ql/test/query-tests/API Abuse/InconsistentEqualsGetHashCode/InconsistentEqualsGetHashCodeGood.cs
2018-08-02 17:53:23 +01:00

18 lines
316 B
C#

using System;
class Good
{
private int id;
public Good(int Id) { this.id = Id; }
public override bool Equals(object other)
{
if (other is Good b && b.GetType() == typeof(Good))
return this.id == b.id;
return false;
}
public override int GetHashCode() => id;
}