Example #1
0
 protected static void SetResponseHeaders(
     HttpResponse response,
     string contentType)
 {
     response.ContentType = contentType ?? ContentType.Json;
     response.StatusCode  = _ok;
 }
Example #2
0
        private async Task WriteResponseAsync(
            HttpResponse response,
            IExecutionResult executionResult)
        {
            if (executionResult is IReadOnlyQueryResult queryResult)
            {
                response.ContentType = ContentType.Json;
                response.StatusCode = _ok;

                await _resultSerializer.SerializeAsync(
                    queryResult, response.Body)
                    .ConfigureAwait(false);
            }
        }