title: Can I change my response data in OutputFormatter in ASP.NET Core 3.1
body: <p>I'm trying to create a simple feature to make the first action act like the second one.</p>
  
  <pre><code>public IActionResult GetMessage()
  {
      return "message";
  }
  
  
  public IActionResult GetMessageDataModel()
  {
      return new MessageDataModel("message");
  }
  </code></pre>
  
  <p>First idea came to my mind was to extend <code>SystemTextJsonOutputFormater</code>, and wrap <code>context.Object</code> with my data model in <code>WriteResponseBodyAsync</code>, but the action is marked <code>sealed</code>.</p>
  
  <p>Then I tried to override <code>WriteAsync</code> but <code>context.Object</code> doesn't have protected setter, either.</p>
  
  <p>Is there anyway I can achieve this by manipulating OutputFormatter?
  Or I have another option instead of a custom <code>OutputFormatter</code>?</p>