I'm trying to output different formats of a type depending on the URL of the request. Up to Preview5 I did the following to get the URI in the MediaTypeFormatters OnWriteToStream-Method:
var requestUri = OperationContext.Current
.IncomingMessageHeaders
.To;
But with Preview6 the OperationContext.Current property is always null. Probably because the formatter gets executed on a different thread. So what is the correct way to get the URI in the MediaTypeFormatter? Or is there an alternative to the MediaTypeFormatter which has the request as argument?
Thank you in advance.
Regards
...
Joachim