Base:
property
Items
Microsoft.AspNetCore.Http.HttpContext.Items
2 writes to Items
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionDispatcher.cs (1)
768
newHttpContext.
Items
= new Dictionary<object, object?>(context.Items);
Microsoft.AspNetCore.Http.Tests (1)
DefaultHttpContextTests.cs (1)
141
context.
Items
= items;
65 references to Items
HttpAbstractions.SampleApp (2)
Program.cs (2)
38
context.
Items
["Item1"] = "Value1";
39
context.
Items
["Item2"] = "Value2";
Microsoft.AspNetCore.Antiforgery.Test (1)
AntiforgeryMiddlewareTest.cs (1)
73
Assert.True(httpContext.
Items
.ContainsKey("__AntiforgeryMiddlewareWithEndpointInvoked"));
Microsoft.AspNetCore.Cors.Test (3)
CorsMiddlewareTests.cs (3)
990
Assert.Contains(httpContext.
Items
, item => string.Equals(item.Key as string, "__CorsMiddlewareWithEndpointInvoked"));
1014
Assert.Contains(httpContext.
Items
, item => string.Equals(item.Key as string, "__CorsMiddlewareWithEndpointInvoked"));
1038
Assert.DoesNotContain(httpContext.
Items
, item => string.Equals(item.Key as string, "__CorsMiddlewareWithEndpointInvoked"));
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
UseMiddlewareTest.cs (2)
273
Assert.True(Assert.IsType<bool>(context.
Items
["before"]));
274
Assert.True(Assert.IsType<bool>(context.
Items
["after"]));
Microsoft.AspNetCore.Http.Extensions.Tests (26)
RequestDelegateFactoryTests.cs (26)
122
Assert.True(httpContext.
Items
["invoked"] as bool?);
145
Assert.True(httpContext.
Items
["invoked"] as bool?);
191
Assert.Equal(1, httpContext.
Items
["invoked"]);
197
Assert.Equal(2, httpContext.
Items
["invoked"]);
263
Assert.Equal(42, httpContext.
Items
["input"]);
280
Assert.Equal(1, context.
Items
["calls"]);
284
Assert.Equal(1, context.
Items
["calls"]);
594
Assert.Null(httpContext.
Items
["tryParsable"]);
620
Assert.NotEmpty(httpContext.
Items
);
621
Assert.Null(httpContext.
Items
["tryParsable"]);
654
Assert.Equal(new StringValues(new[] { "1", "2", "3" }), httpContext.
Items
["query"]);
655
Assert.Equal(new StringValues(new[] { "4", "5", "6" }), httpContext.
Items
["headers"]);
656
Assert.Equal(new StringValues(new[] { "7", "8", "9" }), httpContext.
Items
["form"]!);
682
Assert.Null(httpContext.
Items
["query"]);
683
Assert.Null(httpContext.
Items
["headers"]);
684
Assert.Null(httpContext.
Items
["form"]);
704
Assert.Equal(new MyAwaitedBindAsyncRecord(new Uri("https://example.org")), httpContext.
Items
["myAwaitedBindAsyncRecord"]);
705
Assert.Equal(new MyAwaitedBindAsyncStruct(new Uri("https://example.org")), httpContext.
Items
["myAwaitedBindAsyncStruct"]);
877
var deserializedRequestBody = httpContext.
Items
["body"];
1189
Assert.Same(myOriginalService, httpContext.
Items
["service"]);
1699
Assert.Equal(new Uri("https://example.org"), httpContext.
Items
["uri"]);
1703
Assert.Null(httpContext.
Items
["uri"]);
2225
var invokedInContext = Assert.IsType<bool>(httpContext.
Items
["invoked"]);
3154
Assert.Null(httpContext.
Items
["RequiredRouteParam"]);
3155
Assert.Null(httpContext.
Items
["RequiredQueryParam"]);
3156
Assert.Null(httpContext.
Items
["RequiredHeaderParam"]);
Microsoft.AspNetCore.Http.Tests (10)
ApplicationBuilderTests.cs (1)
102
Assert.True(httpContext.
Items
.ContainsKey("__RequestUnhandled"), "Request unhandled flag should be set.");
DefaultHttpContextTests.cs (6)
112
var items = context.
Items
;
115
Assert.Same(items, context.
Items
);
117
context.
Items
["foo"] = item;
118
Assert.Same(item, context.
Items
["foo"]);
143
Assert.Same(items, context.
Items
);
146
Assert.Same(item, context.
Items
["foo"]);
Timeouts\RequestTimeoutsMiddlewareTests.cs (3)
215
Assert.Equal("default", context.
Items
["SetFrom"]);
235
Assert.Equal("policy1", context.
Items
["SetFrom"]);
252
Assert.False(context.
Items
.ContainsKey("SetFrom"));
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
Filters\AntiforgeryMiddlewareAuthorizationFilterTest.cs (2)
20
httpContext.
Items
[AntiforgeryMiddlewareAuthorizationFilter.AntiforgeryMiddlewareWithEndpointInvokedKey] = new object();
38
httpContext.
Items
[AntiforgeryMiddlewareAuthorizationFilter.AntiforgeryMiddlewareWithEndpointInvokedKey] = new object();
Microsoft.AspNetCore.Routing.Tests (19)
Builder\GroupTest.cs (5)
50
Assert.Equal(42, httpContext.
Items
["id"]);
83
Assert.Equal("dotnet", httpContext.
Items
["org"]);
84
Assert.Equal(42, httpContext.
Items
["id"]);
117
Assert.Equal("dotnet", httpContext.
Items
["org"]);
118
Assert.Equal(42, httpContext.
Items
["id"]);
Builder\RequestDelegateEndpointRouteBuilderExtensionsTest.cs (5)
172
Assert.Equal(1, (int)httpContext.
Items
["First-Order"]!);
173
Assert.Equal(2, (int)httpContext.
Items
["Second-Order"]!);
220
Assert.True((bool)httpContext.
Items
["First"]!);
221
Assert.True((bool)httpContext.
Items
["Second"]!);
222
Assert.False(httpContext.
Items
.ContainsKey("ExecutedEndpoint"));
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (6)
167
Assert.Null(httpContext.
Items
["input"]);
207
Assert.Equal(41, httpContext.
Items
["input"]);
542
Assert.Equal(13, httpContext.
Items
["input"]);
587
Assert.Null(httpContext.
Items
["input"]);
620
Assert.Equal(42, httpContext.
Items
["value"]);
644
Assert.Null(httpContext.
Items
["value"]);
EndpointMiddlewareTest.cs (3)
171
httpContext.
Items
[EndpointMiddleware.AuthorizationMiddlewareInvokedKey] = true;
268
httpContext.
Items
[EndpointMiddleware.CorsMiddlewareInvokedKey] = true;
366
httpContext.
Items
[EndpointMiddleware.AntiforgeryMiddlewareWithEndpointInvokedKey] = true;