What's the most efficient way to get a specific parameter from a relative URL string using C#?

For example, how would you get the value of the ACTION parameter from the following relative URL string:

string url = "/page/example?ACTION=data&FOO=test";

I have already tried using:

var myUri = new Uri(url, UriKind.Relative);
String action = HttpUtility.ParseQueryString(myUri.Query).Get("ACTION");

However, I get the following error:

This operation is not supported for a relative URI.

While many of the URI operations are unavailable for UriKind.Relative (for whatever reason), you can build a fully qualified URI through one of the overloads that takes in a Base URI

Here's an example from the docs on Uri.Query:

Uri baseUri = new Uri ("http://www.contoso.com/");
Uri myUri = new Uri (baseUri, "catalog/shownew.htm?date=today");

Console.WriteLine(myUri.Query); // date=today

You can also get the current base from HttpContext.Current.Request.Url or even just create a mock URI base with "http://localhost" if all you care about is the path components.

So either of the following approaches should also return the QueryString from a relative path:

var path = "catalog/shownew.htm?date=today"
var query1 = new Uri(HttpContext.Current.Request.Url, path).Query;
var query2 = new Uri(new Uri("http://localhost"), path).Query;