Given an absolute URI/URL, I want to get a URI/URL which doesn\'t contain the leaf portion. For example: given http://foo.com/bar/baz.html, I should get http://foo.com/bar/.
PapyRef's answer is incorrect, UriPartial.Path includes the filename.
UriPartial.Path
new Uri(uri, ".").ToString()
seems to be cleanest/simplest implementation of the function requested.