Expert Texture Home Contact me About Subscribe Digipede Connect on LinkedIn rwandering on Twitter rwandering on FriendFeed

rwandering.net

The blogged wandering of Robert W. Anderson

System.Uri.Equals(…) What?

Can someone explain why the following expression evaluates to true?  There must be some historical perspective that I’m just missing.

new Uri("mailto:somebody@example.com") == new Uri("mailto:somebodyelse@example.com")

I would understand:

  1. A use case for a separate Uri.Compare method giving the caller control over which components should be compared;
  2. If Uri.Equals performed its comparison against canonicalized URIs.

The docs say that the user info, fragment, and  (in older .NETs) query are all ignored for comparison.  There is no mention for the email address in a mailto; however.

What?  Why?

[tags].NET, C#, Microsoft, BCL[/tags]

Tags: , , ,

    Trackback

5 Comments »