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