1 write to HttpContext
Microsoft.AspNetCore.Mvc.Abstractions (1)
Formatters\OutputFormatterCanWriteContext.cs (1)
22
HttpContext
= httpContext;
90 references to HttpContext
BasicWebSite (4)
Formatters\CustomFormatter.cs (1)
36
var response = context.
HttpContext
.Response;
Formatters\PlainTextFormatter.cs (1)
34
var response = context.
HttpContext
.Response;
Formatters\VCardFormatter_V3.cs (1)
39
await context.
HttpContext
.Response.WriteAsync(
Formatters\VCardFormatter_V4.cs (1)
42
await context.
HttpContext
.Response.WriteAsync(
Microsoft.AspNetCore.Mvc.Abstractions (2)
Formatters\OutputFormatterCanWriteContext.cs (2)
17
/// <param name="httpContext">The <see cref="
HttpContext
"/> for the current request.</param>
26
/// Gets or sets the <see cref="
HttpContext
"/> context associated with the current operation.
Microsoft.AspNetCore.Mvc.Core (11)
Formatters\HttpNoContentOutputFormatter.cs (1)
36
var response = context.
HttpContext
.Response;
Formatters\OutputFormatter.cs (1)
173
var response = context.
HttpContext
.Response;
Formatters\StreamOutputFormatter.cs (1)
33
var response = context.
HttpContext
.Response;
Formatters\StringOutputFormatter.cs (1)
54
var response = context.
HttpContext
.Response;
Formatters\SystemTextJsonOutputFormatter.cs (2)
66
var httpContext = context.
HttpContext
;
101
catch (OperationCanceledException) when (context.
HttpContext
.RequestAborted.IsCancellationRequested) { }
Formatters\TextOutputFormatter.cs (4)
131
context.
HttpContext
.Response.StatusCode = statusCode;
133
if (context.
HttpContext
.RequestServices.GetService<IProblemDetailsService>() is { } problemDetailsService)
137
HttpContext = context.
HttpContext
,
172
var request = context.
HttpContext
.Request;
Infrastructure\DefaultOutputFormatterSelector.cs (1)
72
var request = context.
HttpContext
.Request;
Microsoft.AspNetCore.Mvc.Core.Test (15)
Formatters\JsonOutputFormatterTestBase.cs (1)
153
var body = outputFormatterContext.
HttpContext
.Response.Body;
Formatters\NoContentFormatterTests.cs (2)
130
Assert.Equal(StatusCodes.Status204NoContent, context.
HttpContext
.Response.StatusCode);
150
Assert.Null(context.
HttpContext
.Response.ContentLength);
Formatters\TextOutputFormatterTests.cs (2)
206
Assert.Equal(MediaTypeHeaderValue.Parse(testContentType.Value), context.
HttpContext
.Response.GetTypedHeaders().ContentType);
231
Assert.Equal(StatusCodes.Status406NotAcceptable, context.
HttpContext
.Response.StatusCode);
Infrastructure\ControllerActionInvokerTest.cs (1)
1728
await c.
HttpContext
.Response.WriteAsync(c.Object.ToString());
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (1)
245
return context.
HttpContext
.Response.WriteAsJsonAsync(context.Object);
Infrastructure\DefaultOutputFormatterSelectorTest.cs (8)
33
context.
HttpContext
.Request.Headers.Accept = "application/xml"; // This will not be used
63
context.
HttpContext
.Request.Headers.Accept = "application/xml"; // This will not be used
92
context.
HttpContext
.Request.Headers.Accept = "application/xml"; // This will not be used
163
context.
HttpContext
.Request.Headers.Accept = acceptHeader;
222
context.
HttpContext
.Request.Headers.Accept = "text/custom,application/custom";
257
context.
HttpContext
.Request.Headers.Accept = "text/custom,application/custom";
286
context.
HttpContext
.Request.Headers.Accept = "text/custom";
315
context.
HttpContext
.Request.Headers.Accept = "text/custom, text/custom2";
Microsoft.AspNetCore.Mvc.Formatters.Xml (6)
XmlDataContractSerializerOutputFormatter.cs (3)
221
var httpContext = context.
HttpContext
;
234
value = await reader(value, context.
HttpContext
.RequestAborted);
236
if (context.
HttpContext
.RequestAborted.IsCancellationRequested)
XmlSerializerOutputFormatter.cs (3)
200
var httpContext = context.
HttpContext
;
212
value = await reader(value, context.
HttpContext
.RequestAborted);
214
if (context.
HttpContext
.RequestAborted.IsCancellationRequested)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (36)
XmlDataContractSerializerOutputFormatterTest.cs (18)
108
var body = outputFormatterContext.
HttpContext
.Response.Body;
172
var body = formatterContext.
HttpContext
.Response.Body;
197
var body = outputFormatterContext.
HttpContext
.Response.Body;
232
var body = outputFormatterContext.
HttpContext
.Response.Body;
263
var body = outputFormatterContext.
HttpContext
.Response.Body;
291
var body = outputFormatterContext.
HttpContext
.Response.Body;
319
var body = outputFormatterContext.
HttpContext
.Response.Body;
340
var body = outputFormatterContext.
HttpContext
.Response.Body;
354
var response = outputFormatterContext.
HttpContext
.Response;
530
var body = outputFormatterContext.
HttpContext
.Response.Body;
577
var body = outputFormatterContext.
HttpContext
.Response.Body;
624
var body = outputFormatterContext.
HttpContext
.Response.Body;
708
outputFormatterContext.
HttpContext
.Request.QueryString = new QueryString("?indent=" + indent);
714
var body = outputFormatterContext.
HttpContext
.Response.Body;
734
outputFormatterContext.
HttpContext
.RequestAborted = cts.Token;
735
outputFormatterContext.
HttpContext
.Response.Body = body;
772
outputFormatterContext.
HttpContext
.Response.Body = body;
831
var request = context.
HttpContext
.Request;
XmlSerializerOutputFormatterTest.cs (18)
62
var body = outputFormatterContext.
HttpContext
.Response.Body;
92
outputFormatterContext.
HttpContext
.Request.QueryString = new QueryString("?indent=" + indent);
98
var body = outputFormatterContext.
HttpContext
.Response.Body;
118
var body = outputFormatterContext.
HttpContext
.Response.Body;
174
var body = formatterContext.
HttpContext
.Response.Body;
197
var body = outputFormatterContext.
HttpContext
.Response.Body;
230
var body = outputFormatterContext.
HttpContext
.Response.Body;
259
var body = outputFormatterContext.
HttpContext
.Response.Body;
285
var body = outputFormatterContext.
HttpContext
.Response.Body;
310
var body = outputFormatterContext.
HttpContext
.Response.Body;
329
Assert.NotNull(outputFormatterContext.
HttpContext
.Response.Body);
330
Assert.True(outputFormatterContext.
HttpContext
.Response.Body.CanRead);
408
var response = outputFormatterContext.
HttpContext
.Response;
414
Assert.NotNull(outputFormatterContext.
HttpContext
.Response.ContentLength);
516
outputFormatterContext.
HttpContext
.RequestAborted = cts.Token;
517
outputFormatterContext.
HttpContext
.Response.Body = body;
554
outputFormatterContext.
HttpContext
.Response.Body = body;
621
var request = context.
HttpContext
.Request;
Microsoft.AspNetCore.Mvc.NewtonsoftJson (6)
NewtonsoftJsonOutputFormatter.cs (6)
140
_jsonOptions ??= context.
HttpContext
.RequestServices.GetRequiredService<IOptions<MvcNewtonsoftJsonOptions>>().Value;
142
var response = context.
HttpContext
.Response;
155
var logger = context.
HttpContext
.RequestServices.GetRequiredService<ILogger<NewtonsoftJsonOutputFormatter>>();
159
value = await reader(value, context.
HttpContext
.RequestAborted);
161
catch (OperationCanceledException) when (context.
HttpContext
.RequestAborted.IsCancellationRequested) { }
163
if (context.
HttpContext
.RequestAborted.IsCancellationRequested)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (10)
NewtonsoftJsonOutputFormatterTest.cs (9)
67
outputFormatterContext.
HttpContext
.RequestServices = services;
139
var body = outputFormatterContext.
HttpContext
.Response.Body;
171
var body = outputFormatterContext2.
HttpContext
.Response.Body;
214
var body = context.
HttpContext
.Response.Body;
266
var body = context.
HttpContext
.Response.Body;
302
var body = context.
HttpContext
.Response.Body;
337
var body = context.
HttpContext
.Response.Body;
397
Assert.NotNull(outputFormatterContext.
HttpContext
.Response.ContentLength);
424
var body = context.
HttpContext
.Response.Body;
src\Mvc\Mvc.Core\test\Formatters\JsonOutputFormatterTestBase.cs (1)
153
var body = outputFormatterContext.
HttpContext
.Response.Body;