From 808a0709814bca7ce1f1c8ee6ad9ad13b6cd873e Mon Sep 17 00:00:00 2001 From: anperederi Date: Wed, 14 Feb 2024 10:16:28 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Update=20overriding=20of=20Equal?= =?UTF-8?q?s=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Banquale/Model/Customer.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Banquale/Model/Customer.cs b/src/Banquale/Model/Customer.cs index c26c1e2..6d22590 100644 --- a/src/Banquale/Model/Customer.cs +++ b/src/Banquale/Model/Customer.cs @@ -30,11 +30,10 @@ namespace Model public Customer(string name, string firstName, string password) : base(name, firstName, password) {} - - public bool Equals(Customer? other) + public override bool Equals(object obj) { - if (other == null) return false; - else return other.Id.Equals(Id); + if (obj == null) return false; + else return obj.Equals(this); } public override int GetHashCode()