public override int GetHashCode() { return(HashCode.Combine( UriInstance.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped), UriInstance.GetComponents(UriComponents.Path, UriFormat.Unescaped), UriInstance.GetComponents(UriComponents.Query, UriFormat.Unescaped), MethodInstance )); }
public bool MatchesExceptQuery(HttpResource that) { if (UriInstance.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped) != that.UriInstance.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped)) { return(false); } if (UriInstance.GetComponents(UriComponents.Path, UriFormat.Unescaped) != that.UriInstance.GetComponents(UriComponents.Path, UriFormat.Unescaped)) { return(false); } if (!MethodInstance.Equals(that.MethodInstance)) { return(false); } return(true); }
public override bool Equals(object obj) { if (!(obj is HttpResource)) { return(false); } var that = (HttpResource)obj; if (!MatchesExceptQuery(that)) { return(false); } if (UriInstance.GetComponents(UriComponents.Query, UriFormat.Unescaped) != that.UriInstance.GetComponents(UriComponents.Query, UriFormat.Unescaped)) { return(false); } return(true); }