GetHashCode() for OrdinalIgnoreCase-dependent string classes
===

    public class Address{
        public string ContactName {get; private set;}
        public string Company {get; private set;}
        //...
        public string Zip {get; private set;}
    }

I'd like to implement a notion of distint addresses, so I overrode Equals() to test for case-insensitive equality in all of the fields (as these are US addresses, I used Ordinal instead of InvariantCulture for maximum performance):

    public override bool Equals(Object obj){
        if (obj == null || this.GetType() != obj.GetType())
            return false;

        Address o = (Address)obj;

        return  
		(string.Compare(this.ContactName, o.ContactName, StringComparison.OrdinalIgnoreCase) == 0) &&
        (string.Compare(this.Company, o.Company, StringComparison.OrdinalIgnoreCase) == 0)
        // ...
        (string.Compare(this.Zip, o.Zip, StringComparison.OrdinalIgnoreCase) == 0)
    }

I'd like to write a GetHashCode() similarly like so (ignore the [concatenation inefficiency][1] for the moment):

    public override int GetHashCode(){
        return (this.contactName + this.address1 + this.zip).ToLowerOrdinal().GetHashCode();
    }

but that doesn't exist. What should I use instead? Or should I just use InvariantCulture?

(I'm thinking `.ToLowerInvariant().GetHashCode()`, but I'm not 100% sure that InvariantCulture can't decide that an identical character (such as an accent) has a different meaning in another context.)


  [1]: http://stackoverflow.com/a/957684/1180926