I have a Web API v2 controller that makes a method call out to a service in the same project. The service uses the UrlHelper
class to put together a URL however, the UrlHelper class needs the HttpRequestMessage
in order to build the proper URL.
How can I obtain the HttpRequestMessage
from within a class (my service) that is outside of the API controller? Can I pass the HttpRequestMessage
into the service method? Is there another way to access from a global context?
I am using a self-hosted environment (OWIN).