diff --git a/Softeq.XToolkit.WhiteLabel/Location/LocationModel.cs b/Softeq.XToolkit.WhiteLabel/Location/LocationModel.cs index 11ab68b6..ca19a1e5 100644 --- a/Softeq.XToolkit.WhiteLabel/Location/LocationModel.cs +++ b/Softeq.XToolkit.WhiteLabel/Location/LocationModel.cs @@ -25,6 +25,11 @@ public override bool Equals(object obj) return Equals(obj as LocationModel); } + public override int GetHashCode() + { + return HashCode.Combine(Latitude, Longitude); + } + public bool Equals(LocationModel other) { if (ReferenceEquals(null, other)) @@ -37,14 +42,8 @@ public bool Equals(LocationModel other) return true; } - return other is LocationModel model && - Latitude == model.Latitude && - Longitude == model.Longitude; - } - - public override int GetHashCode() - { - return HashCode.Combine(Latitude, Longitude); + return Latitude == other.Latitude && + Longitude == other.Longitude; } } } \ No newline at end of file