diff --git a/API_SQLuedo/Dto/UserDTO.cs b/API_SQLuedo/Dto/UserDTO.cs index e035608..d3aa536 100644 --- a/API_SQLuedo/Dto/UserDTO.cs +++ b/API_SQLuedo/Dto/UserDTO.cs @@ -36,21 +36,27 @@ public bool Equals(UserDto? other) { - if (object.ReferenceEquals(other, null)) + return (this.Id == other?.Id); + } + + public override bool Equals(object? obj) + { + if (object.ReferenceEquals(obj, null)) { return false; } - if (object.ReferenceEquals(this, other)) + if (object.ReferenceEquals(this, obj)) { return true; } - if (this.GetType() != other.GetType()) + if (this.GetType() != obj.GetType()) { return false; } - return (this.Id == other.Id); + + return this.Equals(obj as UserDto); } public override int GetHashCode()