I have this code in a class library:
string.Format("{0}://{1}", Current.Request.Url.Scheme, Current.Request.Url.Authority);
This works fine if the application is deployed in the root domain and not a subdomain.
I would like to adapt the above to work for a sub domain as well. In the razor code I can just use:
Url.Content("~/")
Is there an equivalent for this for class libraries ('web independent' C# code)?
'http://www.example.com/controller/action'
, or an application root-relative URL, e.g.'/controller/action'
?'/'
if the ApplicationPath is a sub-folder.