I have the following MVC TypeFormatter code and I need assistance how to:
-
Pass values into this object or reference them from the controller get method
public class ObjectSomeTypeOfFormatter : MediaTypeFormatter { public override Task WriteToStreamAsync(Type type, object value, Stream stream, HttpContentHeaders contentHeaders, TransportContext transportContext) { // Method that I'm overriding where I need to access some variables defined from controller. } }
You can get it from
HttpContext.Curent.Requestand for that you need to have reference toSystem.Webasembly.