Skip to content

Commit

Permalink
Endpoint names broken if it didn't have a namespace. #408
Browse files Browse the repository at this point in the history
  • Loading branch information
distantcam committed Nov 4, 2014
1 parent acc73c3 commit 968e167
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/ServiceInsight.Desktop/SequenceDiagram/EndpointInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public EndpointInfo(Endpoint endpoint, StoredMessage message)
throw new ArgumentNullException("message", "message is null.");

Name = string.Join(".", endpoint.Name.Split('.').Skip(1));
if (string.IsNullOrEmpty(Name))
Name = endpoint.Name;
FullName = endpoint.Name;
Version = message.GetHeaderByKey(MessageHeaderKeys.Version);
Host = endpoint.Host;
Expand All @@ -29,16 +31,18 @@ public EndpointInfo(Endpoint endpoint, StoredMessage message)

public override int GetHashCode()
{
return Name.GetHashCode();
return FullName.GetHashCode() ^ Host.GetHashCode() ^ Version.GetHashCode();
}

public override bool Equals(object obj)
{
var other = obj as EndpointInfo;
if (other != null)
return Name.Equals(other.Name);
if (other == null)
return false;

return false;
return string.Equals(FullName, other.FullName, StringComparison.OrdinalIgnoreCase) &&
string.Equals(Host, other.Host, StringComparison.OrdinalIgnoreCase) &&
string.Equals(Version, other.Version, StringComparison.OrdinalIgnoreCase);
}
}
}

0 comments on commit 968e167

Please sign in to comment.