Esempio n. 1
0
 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
                ));
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
        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);
        }