12 writes to Extensions
BasicWebSite (2)
Controllers\ContactApiController.cs (2)
110Extensions = 124Extensions =
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
ProblemDetailsJsonConverterTest.cs (2)
169Extensions = 224Extensions =
Microsoft.AspNetCore.Http.Extensions.Tests (1)
ProblemDetailsDefaultWriterTest.cs (1)
74Extensions = new Dictionary<string, object>() { { "extensionKey", 1 } }
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (3)
ProblemDetailsWrapperTest.cs (1)
64Extensions =
ValidationProblemDetailsWrapperTest.cs (2)
144Extensions = 193Extensions =
MinimalSample (2)
Program.cs (2)
86"object" => Results.Problem(new ProblemDetails() { Status = 500, Extensions = { { "traceId", "traceId123" } } }), 88"objectValidation" => Results.Problem(new HttpValidationProblemDetails(errors) { Status = 400, Extensions = { { "traceId", "traceId123" } } }),
XmlFormattersWebSite (2)
Controllers\XmlApiControllerBase.cs (2)
24Extensions = 43Extensions =
118 references to Extensions
Diagnostics.FunctionalTests (1)
DeveloperExceptionPageSampleTest.cs (1)
54var exceptionNode = (JsonElement)body.Extensions["exception"];
Microsoft.AspNetCore.Diagnostics (1)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
262problemDetails.Extensions["exception"] = JsonSerializer.SerializeToElement(new ExceptionExtensionData
Microsoft.AspNetCore.Diagnostics.Tests (20)
DeveloperExceptionPageMiddlewareTest.cs (18)
39context.ProblemDetails.Extensions.Add("OriginalExceptionMessage", context.Exception.Message); 70var originalExceptionMessage = ((JsonElement)body.Extensions["OriginalExceptionMessage"]).GetString(); 87context.ProblemDetails.Extensions.Add("OriginalExceptionMessage", feature?.Error.Message); 88context.ProblemDetails.Extensions.Add("EndpointDisplayName", feature?.Endpoint?.DisplayName); 89context.ProblemDetails.Extensions.Add("RouteValue", feature?.RouteValues?["id"]); 90context.ProblemDetails.Extensions.Add("Path", feature?.Path); 123var originalExceptionMessage = ((JsonElement)body.Extensions["OriginalExceptionMessage"]).GetString(); 124var endpointDisplayName = ((JsonElement)body.Extensions["EndpointDisplayName"]).GetString(); 125var routeValue = ((JsonElement)body.Extensions["RouteValue"]).GetString(); 126var path = ((JsonElement)body.Extensions["Path"]).GetString(); 146context.ProblemDetails.Extensions.Add("OriginalExceptionMessage", feature?.Error.Message); 147context.ProblemDetails.Extensions.Add("EndpointDisplayName", feature?.Endpoint?.DisplayName); 148context.ProblemDetails.Extensions.Add("RouteValue", feature?.RouteValues?["id"]); 149context.ProblemDetails.Extensions.Add("Path", feature?.Path); 182var originalExceptionMessage = ((JsonElement)body.Extensions["OriginalExceptionMessage"]).GetString(); 183var endpointDisplayName = ((JsonElement)body.Extensions["EndpointDisplayName"]).GetString(); 184var routeValue = ((JsonElement)body.Extensions["RouteValue"]).GetString(); 185var path = ((JsonElement)body.Extensions["Path"]).GetString();
ExceptionHandlerMiddlewareTest.cs (2)
45context.ProblemDetails.Extensions.Add("OriginalExceptionMessage", context.Exception.Message); 76var originalExceptionMessage = ((JsonElement)body.Extensions["OriginalExceptionMessage"]).GetString();
Microsoft.AspNetCore.Http.Abstractions (1)
ProblemDetails\ProblemDetails.cs (1)
66/// The round-tripping behavior for <see cref="Extensions"/> is determined by the implementation of the Input \ Output formatters.
Microsoft.AspNetCore.Http.Abstractions.Tests (9)
HttpValidationProblemDetailsJsonConverterTest.cs (5)
24problemDetails.Extensions["traceId"] = "|37dd3dd5-4a9619f953c40a16."; 40Assert.Equal((string)problemDetails.Extensions["traceId"]!, document.RootElement.GetProperty("traceId").GetString()); 72problemDetails.Extensions, 113problemDetails.Extensions, 152problemDetails.Extensions,
ProblemDetailsJsonConverterTest.cs (4)
56problemDetails.Extensions, 87problemDetails.Extensions, 119problemDetails.Extensions, 149problemDetails.Extensions,
Microsoft.AspNetCore.Http.Extensions (1)
DefaultProblemDetailsWriter.cs (1)
59context.ProblemDetails.Extensions["traceId"] = traceId;
Microsoft.AspNetCore.Http.Extensions.Tests (19)
ProblemDetailsDefaultWriterTest.cs (19)
56Assert.Equal(expectedTraceId, problemDetails.Extensions["traceId"].ToString()); 161Assert.Equal(expectedTraceId, problemDetails.Extensions["traceId"].ToString()); 201Assert.Equal(expectedTraceId, problemDetails.Extensions["traceId"].ToString()); 241Assert.Equal(expectedTraceId, problemDetails.Extensions["traceId"].ToString()); 281Assert.Equal(expectedTraceId, problemDetails.Extensions["traceId"].ToString()); 324Assert.Equal(expectedTraceId, problemDetails.Extensions["traceId"].ToString()); 367Assert.Equal(expectedTraceId, problemDetails.Extensions["traceId"].ToString()); 410Assert.Equal(expectedTraceId, problemDetails.Extensions["traceId"].ToString()); 453Assert.Equal(expectedTraceId, problemDetails.Extensions["traceId"].ToString()); 465expectedProblem.Extensions["Extension1"] = "Extension1-Value"; 466expectedProblem.Extensions["Extension2"] = "Extension2-Value"; 481Assert.Collection(problemDetails.Extensions, 512expectedProblem.Extensions["Extension"] = customExtensionData; 529Assert.Collection(problemDetails.Extensions, 564Assert.Equal(expectedTraceId, problemDetails.Extensions["traceId"].ToString()); 578context.ProblemDetails.Extensions["new-extension"] = new { TraceId = Guid.NewGuid() }; 579context.ProblemDetails.Extensions["traceId"] = expectedTraceId; 600Assert.Contains("new-extension", problemDetails.Extensions); 601Assert.Equal(expectedTraceId, problemDetails.Extensions["traceId"].ToString());
Microsoft.AspNetCore.Http.Results (10)
Results.cs (5)
712/// <param name="extensions">The value for <see cref="ProblemDetails.Extensions" />.</param> 731/// <param name="extensions">The value for <see cref="ProblemDetails.Extensions" />.</param> 762/// <param name="extensions">The value for <see cref="ProblemDetails.Extensions" />.</param> 786/// <param name="extensions">The value for <see cref="ProblemDetails.Extensions" />.</param> 823problemDetails.Extensions.Add(extension);
TypedResults.cs (5)
755/// <param name="extensions">The value for <see cref="ProblemDetails.Extensions" />.</param> 776/// <param name="extensions">The value for <see cref="ProblemDetails.Extensions" />.</param> 822/// <param name="extensions">The value for <see cref="ProblemDetails.Extensions" />.</param> 843/// <param name="extensions">The value for <see cref="ProblemDetails.Extensions" />.</param> 877problemDetails.Extensions.Add(extension);
Microsoft.AspNetCore.Http.Results.Tests (15)
ResultsTests.cs (8)
1268Assert.Equal(extensions, result.ProblemDetails.Extensions); 1292Assert.Equal(extensions, result.ProblemDetails.Extensions); 1316Assert.Equal(extensions, result.ProblemDetails.Extensions); 1337Assert.NotNull(result.ProblemDetails.Extensions); 1338Assert.Empty(result.ProblemDetails.Extensions); 1354Assert.Empty(result.ProblemDetails.Extensions); 1423Assert.Equal(extensions, result.ProblemDetails.Extensions); 1454Assert.Equal(extensions, result.ProblemDetails.Extensions);
TypedResultsTests.cs (7)
1084Assert.Equal(extensions, result.ProblemDetails.Extensions); 1108Assert.Equal(extensions, result.ProblemDetails.Extensions); 1129Assert.NotNull(result.ProblemDetails.Extensions); 1130Assert.Empty(result.ProblemDetails.Extensions); 1146Assert.Empty(result.ProblemDetails.Extensions); 1210Assert.Equal(extensions, result.ProblemDetails.Extensions); 1236Assert.Equal(extensions, result.ProblemDetails.Extensions);
Microsoft.AspNetCore.Mvc.Core (8)
ControllerBase.cs (4)
1855/// <param name="extensions">The value for <see cref="ProblemDetails.Extensions" />.</param> 1894problemDetails.Extensions.Add(extension); 1973/// <param name="extensions">The value for <see cref="ProblemDetails.Extensions" />.</param> 2017validationProblem.Extensions.Add(extension);
Infrastructure\DefaultApiProblemDetailsWriter.cs (3)
64if (context.ProblemDetails?.Extensions is not null) 66foreach (var extension in context.ProblemDetails.Extensions) 68problemDetails.Extensions[extension.Key] = extension.Value;
Infrastructure\DefaultProblemDetailsFactory.cs (1)
108problemDetails.Extensions["traceId"] = traceId;
Microsoft.AspNetCore.Mvc.Core.Test (23)
ControllerBaseTest.cs (6)
2361Assert.Equal("some-trace", problemDetails.Extensions["traceId"]); 2449Assert.Equal(1, problemDetails.Extensions["ext1"]); 2450Assert.Equal(2, problemDetails.Extensions["ext2"]); 2480Assert.Equal("some-trace", problemDetails.Extensions["traceId"]); 2526Assert.Equal(1, problemDetails.Extensions["ext1"]); 2527Assert.Equal(2, problemDetails.Extensions["ext2"]);
DependencyInjection\ApiBehaviorOptionsSetupTest.cs (2)
110Assert.Equal(Activity.Current.Id, problemDetails.Extensions["traceId"]); 127Assert.Equal("42", problemDetails.Extensions["traceId"]);
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (4)
101expectedProblem.Extensions["Extension1"] = "Extension1-Value"; 102expectedProblem.Extensions["Extension2"] = "Extension2-Value"; 117Assert.Contains("Extension1", problemDetails.Extensions); 118Assert.Contains("Extension2", problemDetails.Extensions);
Infrastructure\ProblemDetailsFactoryTest.cs (6)
28problemDetails.Extensions, 49problemDetails.Extensions, 72problemDetails.Extensions, 95problemDetails.Extensions, 125problemDetails.Extensions, 157problemDetails.Extensions,
Infrastructure\ProblemDetalsClientErrorFactoryTest.cs (2)
91Assert.Equal(Activity.Current.Id, problemDetails.Extensions["traceId"]); 117Assert.Equal("42", problemDetails.Extensions["traceId"]);
Infrastructure\ValidationProblemDetailsJsonConverterTest.cs (3)
38problemDetails.Extensions, 78problemDetails.Extensions, 116problemDetails.Extensions,
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
ProblemDetailsWrapper.cs (2)
109ProblemDetails.Extensions.Add(name, value); 152foreach (var keyValuePair in ProblemDetails.Extensions)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (3)
ProblemDetailsWrapperTest.cs (1)
38problemDetails.Extensions.OrderBy(kvp => kvp.Key),
ValidationProblemDetailsWrapperTest.cs (2)
42problemDetails.Extensions.OrderBy(kvp => kvp.Key), 98problemDetails.Extensions,
Microsoft.AspNetCore.Mvc.FunctionalTests (3)
ApiBehaviorTest.cs (3)
90problemDetails.Extensions, 308problemDetails.Extensions, 370validationProblemDetails.Extensions,
Microsoft.AspNetCore.Mvc.NewtonsoftJson (2)
AnnotatedProblemDetails.cs (2)
23foreach (var kvp in problemDetails.Extensions) 57problemDetails.Extensions[kvp.Key] = kvp.Value;