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