title: Azure Functions 2 - How to control json serialization settings
body: <p>I want to be able to control how json is formatted when I return a content result from a Azure Function (V2). The following is a simplified version of what I am doing:</p>
  
  <pre><code>[FunctionName("CreateThing")]
  public static async Task&lt;IActionResult&gt; CreateThingAsync([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "thing")]HttpRequest req, ILogger log)
  {
      try{
          var result = await GetResultAsync(req);
          return new CreatedResult($"thing/{result.id}", result);
      }
      catch(ErrorException) {
          return new BadRequestObjectResult(e.Error);
      }
  }
  </code></pre>
  
  <p>Is there a way to control how the results are formatted when they are returned, without using attributes on my models? I want to be able to use JsonSerializerSettings but I cant find a way of being able to configure this for the results that are returned as per the example above.</p>