21 writes to Values
Microsoft.AspNetCore.Mvc.Core.Test (14)
RedirectToPageResultTest.cs (2)
199Values = 249Values =
Routing\UrlHelperExtensionsTest.cs (12)
21Values = 213Values = 256Values = 304Values = 352Values = 395Values = 506Values = 564Values = 727Values = 775Values = 823Values = 877Values =
Microsoft.AspNetCore.Mvc.RazorPages.Test (6)
Infrastructure\DefaultPageHandlerMethodSelectorTest.cs (6)
304Values = 354Values = 405Values = 500Values = 595Values = 705Values =
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
RemoteAttributeTest.cs (1)
397Values =
258 references to Values
BasicWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
45routeValues = new Dictionary<string, object>(_actionContext.RouteData.Values),
DefaultBuilder.SampleApp (5)
Program.cs (5)
45.MapGet("hello/{name}", (req, res, data) => res.WriteAsync($"Hello, {data.Values["name"]}")) 46.MapGet("goodbye/{name}", (req, res, data) => res.WriteAsync($"Goodbye, {data.Values["name"]}")) 47.MapGet("throw/{message?}", (req, res, data) => throw new Exception((string)data.Values["message"] ?? "Uh oh!")) 48.MapGet("{greeting}/{name}", (req, res, data) => res.WriteAsync($"{data.Values["greeting"]}, {data.Values["name"]}"))
GenericHostWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
45routeValues = new Dictionary<string, object>(_actionContext.RouteData.Values),
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\EndpointHtmlRenderer.cs (1)
122routingStateProvider.RouteData = new RouteData(componentType, httpContext.GetRouteData().Values);
Microsoft.AspNetCore.Mvc.Core (18)
ApplicationModels\ActionModel.cs (1)
126/// <see cref="RouteData.Values"/> for the corresponding action to be selected.
ApplicationModels\ControllerModel.cs (1)
124/// <see cref="RouteData.Values"/> for the corresponding action to be selected.
Formatters\FormatFilter.cs (1)
39if (context.RouteData.Values.TryGetValue("format", out var obj))
Infrastructure\ActionSelector.cs (2)
69var matches = cache.Select(context.RouteData.Values); 75_logger.NoActionsMatched(context.RouteData.Values);
ModelBinding\RouteValueProviderFactory.cs (1)
20context.ActionContext.RouteData.Values);
Routing\IRouteValueProvider.cs (5)
13/// to the <see cref="RouteData.Values"/> when the action is selected. 29/// <see cref="RouteData.Values"/> must contain the values 48/// For <see cref="RouteData.Values"/> like: 56/// <see cref="RouteData.Values"/> does not contain the value 'Blog' for 'area'. 58/// For <see cref="RouteData.Values"/> like:
Routing\MvcAttributeRouteHandler.cs (2)
57_logger.NoActionsMatched(context.RouteData.Values); 65context.RouteData.Values[kvp.Key] = kvp.Value;
Routing\MvcRouteHandler.cs (2)
46_logger.NoActionsMatched(context.RouteData.Values); 53_logger.NoActionsMatched(context.RouteData.Values);
Routing\NormalizedRouteValue.cs (1)
27if (!context.RouteData.Values.TryGetValue(key, out var routeValue))
Routing\UrlHelperBase.cs (1)
34AmbientValues = actionContext.RouteData.Values;
UrlHelperExtensions.cs (1)
479var ambientValues = urlHelper.ActionContext.RouteData.Values;
Microsoft.AspNetCore.Mvc.Core.Test (67)
ConsumesAttributeTests.cs (1)
412routeContext.RouteData.Values.Add(kvp.Key, kvp.Value);
Formatters\FormatFilterTest.cs (3)
74data.Values.Add("format", "json"); 309context.RouteData.Values["format"] = new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)); 435data.Values.Add("format", format);
Infrastructure\ActionSelectorTest.cs (41)
55routeContext.RouteData.Values.Add("controller", "Home"); 56routeContext.RouteData.Values.Add("action", "Index"); 95routeContext.RouteData.Values.Add("controller", "Home"); 96routeContext.RouteData.Values.Add("action", "Index"); 97routeContext.RouteData.Values.Add( 136routeContext.RouteData.Values.Add("controller", "Home"); 137routeContext.RouteData.Values.Add("action", "Index"); 174routeContext.RouteData.Values.Add("controller", "Foo"); 175routeContext.RouteData.Values.Add("action", "Index"); 207routeContext.RouteData.Values.Add("controller", "Home"); 208routeContext.RouteData.Values.Add("action", "Index"); 259routeContext.RouteData.Values.Add("controller", "Home"); 260routeContext.RouteData.Values.Add("action", "Index"); 311routeContext.RouteData.Values.Add("controller", "HOME"); 312routeContext.RouteData.Values.Add("action", "iNDex"); 343routeContext.RouteData.Values.Add("area", ""); 344routeContext.RouteData.Values.Add("controller", "Home"); 345routeContext.RouteData.Values.Add("action", "Index"); 377routeContext.RouteData.Values.Add("area", ""); 378routeContext.RouteData.Values.Add("controller", "HoMe"); 379routeContext.RouteData.Values.Add("action", "InDeX"); 411routeContext.RouteData.Values.Add("area", null); 412routeContext.RouteData.Values.Add("controller", "Home"); 413routeContext.RouteData.Values.Add("action", "Index"); 445routeContext.RouteData.Values.Add("foo", ""); 446routeContext.RouteData.Values.Add("controller", "Home"); 447routeContext.RouteData.Values.Add("action", "Index"); 479routeContext.RouteData.Values.Add("foo", null); 480routeContext.RouteData.Values.Add("controller", "Home"); 481routeContext.RouteData.Values.Add("action", "Index"); 834context.RouteData.Values.Add("controller", "Store"); 835context.RouteData.Values.Add("action", "Buy"); 857routeContext.RouteData.Values.Add("controller", "HttpMethodAttributeTests_RestOnly"); 858routeContext.RouteData.Values.Add("action", "Patch"); 878routeContext.RouteData.Values.Add("controller", "HttpMethodAttributeTests_RestOnly"); 879routeContext.RouteData.Values.Add("action", "Put"); 896routeContext.RouteData.Values.Add("controller", "HttpMethodAttributeTests_RestOnly"); 933routeContext.RouteData.Values.Add("controller", "ActionName"); 934routeContext.RouteData.Values.Add("action", "RPCMethodWithHttpGet"); 963routeContext.RouteData.Values.Add("controller", "ActionName"); 964routeContext.RouteData.Values.Add("action", actionName);
Infrastructure\ControllerActionInvokerTest.cs (1)
46routeData.Values.Add("tag", "value");
RedirectToPageResultTest.cs (1)
91pageContext.RouteData.Values.Add("page", "/A/Redirecting/Page");
Routing\AttributeRouteTest.cs (4)
55if (routeContext.RouteData.Values.ContainsKey("key1")) 59else if (routeContext.RouteData.Values.ContainsKey("key2")) 91Assert.Equal("5", context.RouteData.Values["key2"]); 108Assert.Empty(context.RouteData.Values);
Routing\EndpointRoutingUrlHelperTest.cs (1)
87urlHelper.ActionContext.RouteData.Values["id"] = "500";
Routing\MvcRouteHandlerTests.cs (2)
31context.RouteData.Values.Add("controller", "Home"); 32context.RouteData.Values.Add("action", "Index");
Routing\UrlHelperTestBase.cs (13)
964routeData.Values.Add("first", "a"); 965routeData.Values.Add("controller", "Store"); 966routeData.Values.Add("action", "Buy"); 970RouteValues = routeData.Values 1002routeData.Values.Add("first", "a"); 1003routeData.Values.Add("second", "x"); 1004routeData.Values.Add("controller", "Store"); 1005routeData.Values.Add("action", "Buy"); 1009RouteValues = routeData.Values 1043routeData.Values.Add("first", "a"); 1044routeData.Values.Add("controller", "Store"); 1045routeData.Values.Add("action", "Buy"); 1049RouteValues = routeData.Values
Microsoft.AspNetCore.Mvc.Razor.Test (7)
RazorViewEngineTest.cs (7)
1620actionContext.RouteData.Values[key] = "route-value"; 1644actionContext.RouteData.Values[key] = new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)); 1667actionContext.RouteData.Values[key] = "route-value"; 1690actionContext.RouteData.Values[key] = "route-value"; 1717actionContext.RouteData.Values[key] = 43; 2124routeData.Values.Add(kvp.Key, kvp.Value); 2139routeData.Values.Add(kvp.Key, kvp.Value);
Microsoft.AspNetCore.Mvc.RazorPages (2)
ApplicationModels\PageRouteModel.cs (1)
94/// Gets a collection of route values that must be present in the <see cref="RouteData.Values"/>
Infrastructure\DefaultPageHandlerMethodSelector.cs (1)
149var handlerName = Convert.ToString(context.RouteData.Values[Handler], CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Mvc.RazorPages.Test (2)
Infrastructure\PageActionInvokerTest.cs (2)
38routeData.Values.Add("tag", "value"); 66routeData.Values.Add("tag", "value");
Microsoft.AspNetCore.Mvc.Routing.Abstractions.Tests (23)
RouteDataTest.cs (23)
19Assert.Empty(routeData.Values); 30original.Values.Add("route", "value"); 39Assert.NotSame(routeData.Values, original.Values); 40Assert.Equal(routeData.Values, original.Values); 57Assert.Equal(routeData.Values, copy.Values); 74Assert.Equal(routeData.Values, copy.Values); 84original.Values.Add("bleh", "16"); 96Assert.Equal(routeData.Values, original.Values); 109routeData.Values.Add("route", "value"); 119Assert.Empty(routeData.Values); 120Assert.NotEqual(routeData.Values, copy.Values); 130original.Values.Add("route", "value1"); 142routeData.Values.Add("route2", "value"); 152Assert.Equal(original.Values, routeData.Values); 153Assert.NotEqual(routeData.Values, copy.Values);
Microsoft.AspNetCore.Mvc.TagHelpers (1)
Cache\CacheTagKey.cs (1)
93tagHelper.ViewContext.RouteData.Values,
Microsoft.AspNetCore.Mvc.TagHelpers.Test (4)
CacheTagKeyTest.cs (4)
291cacheTagHelper.ViewContext.RouteData.Values["id"] = 4; 292cacheTagHelper.ViewContext.RouteData.Values["category"] = "MyCategory"; 314cacheTagHelper.ViewContext.RouteData.Values["id"] = 4; 315cacheTagHelper.ViewContext.RouteData.Values["category"] =
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
PartialViewResultExecutor.cs (1)
168if (!context.RouteData.Values.TryGetValue(ActionNameKey, out var routeValue))
ViewResultExecutor.cs (1)
168if (!context.RouteData.Values.TryGetValue(ActionNameKey, out var routeValue))
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (5)
PartialViewResultExecutorTest.cs (2)
83context.RouteData.Values["action"] = new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)); 336routeData.Values["action"] = actionName;
RemoteAttributeTest.cs (1)
405routeData.Values["area"] = currentArea;
ViewResultExecutorTest.cs (2)
82context.RouteData.Values["action"] = new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)); 326routeData.Values["action"] = actionName;
Microsoft.AspNetCore.Routing (5)
RouteBase.cs (2)
115if (!_matcher.TryMatch(requestPath, context.RouteData.Values)) 130context.RouteData.Values,
RouterMiddleware.cs (1)
61httpContext.Request.RouteValues = context.RouteData.Values;
Tree\TreeRouter.cs (2)
196if (!matcher.TryMatch(context.HttpContext.Request.Path, context.RouteData.Values)) 202context.RouteData.Values,
Microsoft.AspNetCore.Routing.Abstractions (6)
RouteData.cs (5)
117/// <see cref="Values"/>, and merging <paramref name="dataTokens"/> into <see cref="DataTokens"/>. 130/// A <see cref="RouteValueDictionary"/> to merge into <see cref="Values"/>. If <c>null</c>, then 131/// <see cref="Values"/> will not be changed. 172Values[kvp.Key] = kvp.Value; 193public DictionaryItemDebugView<string, object?>[] Items => _routeData.Values.Select(pair => new DictionaryItemDebugView<string, object>(pair)).ToArray();
RoutingHttpContextExtensions.cs (1)
30/// Gets a route value from <see cref="RouteData.Values"/> associated with the provided
Microsoft.AspNetCore.Routing.FunctionalTests (5)
WebHostBuilderExtensionsTest.cs (5)
24(rb) => rb.MapGet("greeting/{name}", (req, resp, routeData) => resp.WriteAsync($"Hello! {routeData.Values["name"]}")), 35await resp.WriteAsync($"{routeData.Values["name"]} {data}"); 47await resp.WriteAsync($"{routeData.Values["name"]} {data}"); 53(rb) => rb.MapDelete("greeting/{name}", (req, resp, routeData) => resp.WriteAsync($"Hello! {routeData.Values["name"]}")), 65await resp.WriteAsync($"{routeData.Values["name"]} {data}");
Microsoft.AspNetCore.Routing.Microbenchmarks (2)
src\Http\Routing\test\UnitTests\Matching\RouteMatcher.cs (1)
27httpContext.Request.RouteValues = routeContext.RouteData.Values;
src\Http\Routing\test\UnitTests\Matching\TreeRouterMatcher.cs (1)
28httpContext.Request.RouteValues = routeContext.RouteData.Values;
Microsoft.AspNetCore.Routing.Tests (93)
EndpointRoutingMiddlewareTest.cs (2)
110routeData.Values["testKey"] = "testValue"; 133routeData.Values["testKey"] = "testValue";
Matching\RouteMatcher.cs (1)
27httpContext.Request.RouteValues = routeContext.RouteData.Values;
Matching\TreeRouterMatcher.cs (1)
28httpContext.Request.RouteValues = routeContext.RouteData.Values;
RouterMiddlewareTest.cs (3)
40Assert.Single(routingFeature.RouteData.Values); 42Assert.True(routingFeature.RouteData.Values.ContainsKey("id")); 44Assert.Equal("10", routingFeature.RouteData.Values["id"]);
RouteTest.cs (45)
59var originalRouteDataValues = context.RouteData.Values; 71routeValues = ctx.RouteData.Values; 95Assert.True(context.RouteData.Values.ContainsKey("country")); 96Assert.Equal("USA", context.RouteData.Values["country"]); 97Assert.True(context.RouteData.Values.ContainsKey("id")); 98Assert.Equal("5", context.RouteData.Values["id"]); 99Assert.Same(originalRouteDataValues, context.RouteData.Values); 113var originalRouteDataValues = context.RouteData.Values; 125routeValues = ctx.RouteData.Values; 156Assert.True(context.RouteData.Values.ContainsKey("country")); 157Assert.Equal("USA", context.RouteData.Values["country"]); 158Assert.True(context.RouteData.Values.ContainsKey("id")); 159Assert.Equal("5", context.RouteData.Values["id"]); 179routeValues = ctx.RouteData.Values; 203Assert.True(context.RouteData.Values.ContainsKey("id")); 204Assert.Equal("5", context.RouteData.Values["id"]); 221routeValues = ctx.RouteData.Values; 245Assert.True(context.RouteData.Values.ContainsKey("ssn")); 246Assert.Equal("123-456-7890", context.RouteData.Values["ssn"]); 263routeValues = ctx.RouteData.Values; 286Assert.False(context.RouteData.Values.ContainsKey("id")); 303routeValues = ctx.RouteData.Values; 337Assert.True(context.RouteData.Values.ContainsKey("id")); 338Assert.Equal("5", context.RouteData.Values["id"]); 355routeValues = ctx.RouteData.Values; 391Assert.Equal(2, context.RouteData.Values.Count); 392Assert.Equal("Home", context.RouteData.Values["controller"]); 393Assert.Equal("Index", context.RouteData.Values["action"]); 408Assert.Empty(context.RouteData.Values); 423Assert.Equal(2, context.RouteData.Values.Count); 424Assert.Equal("Home", context.RouteData.Values["controller"]); 425Assert.Equal("Index", context.RouteData.Values["action"]); 478var value = Assert.Single(context.RouteData.Values); 511Assert.Null(context.RouteData.Values["1controller"]); 526Assert.Equal(3, context.RouteData.Values.Count); 527Assert.Equal("Home", context.RouteData.Values["controller"]); 528Assert.Equal("Create", context.RouteData.Values["action"]); 529Assert.Equal("xml", context.RouteData.Values["format"]); 544Assert.Equal(2, context.RouteData.Values.Count); 545Assert.Equal("Home", context.RouteData.Values["controller"]); 546Assert.Equal("Create", context.RouteData.Values["action"]); 561Assert.Equal(3, context.RouteData.Values.Count); 562Assert.Equal("Home", context.RouteData.Values["controller"]); 563Assert.Equal("Create", context.RouteData.Values["action"]); 564Assert.Equal("xml", context.RouteData.Values["format"]);
Tree\TreeRouterTest.cs (41)
56Assert.Equal(expectedRouteGroup, context.RouteData.Values["test_route_group"]); 117Assert.Equal(expectedRouteGroup, context.RouteData.Values["test_route_group"]); 164Assert.Equal(expectedRouteGroup, context.RouteData.Values["test_route_group"]); 167var data = Assert.Single(context.RouteData.Values, v => v.Key == entry.Key); 216Assert.Equal(expectedRouteGroup, context.RouteData.Values["test_route_group"]); 219var data = Assert.Single(context.RouteData.Values, v => v.Key == entry.Key); 259Assert.Equal(expectedRouteGroup, context.RouteData.Values["test_route_group"]); 262var data = Assert.Single(context.RouteData.Values, v => v.Key == entry.Key); 394Assert.Equal(expectedRouteGroup, context.RouteData.Values["test_route_group"]); 541Assert.Equal(expectedResult, context.RouteData.Values["path"]); 563Assert.Null(context.RouteData.Values["path"]); 579context.RouteData.Values["path"] = "existing-value"; 586Assert.Equal("existing-value", context.RouteData.Values["path"]); 602context.RouteData.Values["path"] = "existing-value"; 609Assert.Equal("default", context.RouteData.Values["path"]); 638Assert.Equal(expectedRouteGroup, context.RouteData.Values["test_route_group"]); 666Assert.Equal(expectedRouteGroup, context.RouteData.Values["test_route_group"]); 695Assert.Equal(expectedRouteGroup, context.RouteData.Values["test_route_group"]); 745Assert.Equal(p1, context.RouteData.Values["p1"]); 749Assert.Equal(p2, context.RouteData.Values["p2"]); 753Assert.Equal(p3, context.RouteData.Values["p3"]); 1706originalRouteData.Values.Add("path", "default"); 1712Assert.Equal("Bar", context.RouteData.Values["path"]); 1726originalRouteData.Values.Add("path", "default"); 1732Assert.Equal("default", context.RouteData.Values["path"]); 1747nestedValues = new RouteValueDictionary(c.RouteData.Values); 1760routeData.Values.Add("action", "Index"); 1762var originalValues = new RouteValueDictionary(context.RouteData.Values); 1768Assert.Equal(originalValues, context.RouteData.Values); 1769Assert.NotEqual(nestedValues, context.RouteData.Values); 1784nestedValues = new RouteValueDictionary(c.RouteData.Values); 1796context.RouteData.Values.Add("action", "Index"); 1802Assert.NotEqual(nestedValues, context.RouteData.Values); 1805Assert.Equal("Index", context.RouteData.Values["action"]); 1807Assert.DoesNotContain(context.RouteData.Values, kvp => kvp.Key == "test_route_group"); 1828nestedValues = new RouteValueDictionary(c.RouteData.Values); 1839context.RouteData.Values.Add("action", "Index"); 1845Assert.NotEqual(nestedValues, context.RouteData.Values); 1847Assert.Equal("Index", context.RouteData.Values["action"]); 1849Assert.DoesNotContain(context.RouteData.Values, kvp => kvp.Key == "test_route_group"); 1874nestedValues = new RouteValueDictionary(c.RouteData.Values);
Mvc.RoutingWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
45routeValues = new Dictionary<string, object>(_actionContext.RouteData.Values),
RazorPagesWebSite (1)
Pages\CustomModelTypeModel.cshtml.cs (1)
79RouteData.Values.Add(nameof(Attempts), Attempts);
RoutingSandbox (2)
UseRouterStartup.cs (2)
25return httpContext.Response.WriteAsync($"Verb = {request.Method.ToUpperInvariant()} - Path = {request.Path} - Route values - {string.Join(", ", httpContext.GetRouteData().Values)}"); 28routes.MapGet("api/get/{id}", (request, response, routeData) => response.WriteAsync($"API Get {routeData.Values["id"]}"))
RoutingWebSite (3)
UseRouterStartup.cs (3)
25return httpContext.Response.WriteAsync($"Verb = {request.Method.ToUpperInvariant()} - Path = {request.Path} - Route values - {string.Join(", ", httpContext.GetRouteData().Values)}"); 28routes.MapGet("api/get/{id}", (request, response, routeData) => response.WriteAsync($"API Get {routeData.Values["id"]}")) 45routes.MapGet("api/get/{id}", (request, response, routeData) => response.WriteAsync($"{name} - API Get {routeData.Values["id"]}"));
VersioningWebSite (1)
src\Mvc\test\WebSites\Common\TestResponseGenerator.cs (1)
45routeValues = new Dictionary<string, object>(_actionContext.RouteData.Values),