I’m still wondering why am I using System.Uri! While in general this works perfectly, but has a really really annoying implementation detail that drives me crazy! Why? Try this:
var uri = new System.Uri("http://temp.uri/document"); var anotherUri = new System.Uri("http://temp.uri/document#fragment"); Assert.Equals(uri.Equals(anotherUri));
It’ll pass! Why? Implementation assumes that you’re a client, thus no fragment should be sent to the server. This enforces the fact that the Uri used identifies a document regardles it’s internal parts idenfied by the fragment itself. But in URSA’s case we’re server here! I remember that when writing Romantic.Web we decided to introduce EntityId for that (and few other) reason as we needed literal comparison rather than smart one. Another reason would be fact that most of the properties doesn’t work for relative Uris.
I’m more and more convinced that I should drop System.Uri in favour of some other structure. I do remember such structures i.e. from Nancy FX, but I remember also that it lack few features known from System.Uri.
I must consider it carefuly as creating such a structure is not that easy as it sounds. Why? Read RFC 3986 - its about 55 pages of specification, excluding index.