1 write to Name
Microsoft.AspNetCore.Routing (1)
Patterns\RoutePatternParameterPart.cs (1)
39Name = parameterName;
156 references to Name
Microsoft.AspNetCore.App.Analyzers.Test (3)
RouteEmbeddedLanguage\RoutePatternParserTests.cs (3)
207if (tree.TryGetRouteParameter(parsedRoutePattern.Name, out var routeParameter)) 223throw new Exception($"Couldn't find parameter '{parsedRoutePattern.Name}'."); 228throw new Exception($"Parsing '{token.ValueText}' has route parameter '{parsedRoutePattern.Name}' mismatch.", ex);
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (1)
JsonTranscodingServiceMethodProviderTests.cs (1)
33Assert.Equal("name", endpoint.RoutePattern.Parameters[0].Name);
Microsoft.AspNetCore.Mvc.ApiExplorer (3)
EndpointMetadataApiDescriptionProvider.cs (3)
204var name = pattern.GetParameter(parameterName)?.Name ?? parameterName; 258var name = pattern.GetParameter(parameterName)?.Name ?? parameterName; 296return (BindingSource.Path, routeParam.Name, false, displayType);
Microsoft.AspNetCore.Mvc.Core (2)
Routing\ActionEndpointFactory.cs (1)
316resolvedRequiredValues.Remove(parameter.Name);
Routing\RoutePatternWriter.cs (1)
45sb.Append(parameterPart.Name);
Microsoft.AspNetCore.OpenApi (2)
Extensions\ApiDescriptionExtensions.cs (1)
65strippedRoute.Append(parameterPart.Name);
Services\OpenApiGenerator.cs (1)
385var name = attributeName ?? (pattern.GetParameter(parameter.Name) is { } routeParameter ? routeParameter.Name : parameter.Name);
Microsoft.AspNetCore.Routing (48)
Matching\DfaMatcherBuilder.cs (14)
325if (endpoint.RoutePattern.ParameterPolicies.TryGetValue(parameterPart.Name, out var parameterPolicyReferences)) 392if (!routeValues.TryGetValue(partParameter.Name, out var parameterValue)) 400if (endpoint.RoutePattern.ParameterPolicies.TryGetValue(partParameter.Name, out var parameterPolicyReferences)) 406if (parameterPolicy is IParameterLiteralNodeMatchingPolicy constraint && !constraint.MatchesLiteral(partParameter.Name, (string)parameterValue)) 443if (!hasFailingPolicy[literalIndex] && !constraint.MatchesLiteral(parameterPart.Name, literal)) 475if (endpoint.RoutePattern.ParameterPolicies.TryGetValue(parameterPart.Name, out var parameterPolicyReferences)) 489var literalValue = requiredValue?.ToString() ?? throw new InvalidOperationException($"Required value for literal '{parameterPart.Name}' must evaluate to a non-null string."); 767if (!_assignments.TryGetValue(parameterPart.Name, out var slotIndex)) 770_assignments.Add(parameterPart.Name, slotIndex); 776_slots.Add(new KeyValuePair<string, object>(parameterPart.Name, requiredValue)); 781_slots.Add(hasDefaultValue ? new KeyValuePair<string, object>(parameterPart.Name, parameterPart.Default) : default); 792catchAll = (parameterPart.Name, i, slotIndex); 796_captures.Add((parameterPart.Name, i, slotIndex)); 982if (!routePattern.RequiredValues.TryGetValue(parameterPart.Name, out value))
Patterns\DefaultRoutePatternTransformer.cs (1)
228var updatedParameter = RoutePatternFactory.ParameterPart(parameter.Name, @default: null, parameter.ParameterKind, parameter.ParameterPolicies);
Patterns\RoutePattern.cs (1)
148if (string.Equals(parameter.Name, name, StringComparison.OrdinalIgnoreCase))
Patterns\RoutePatternFactory.cs (9)
506if (string.Equals(kvp.Key, parameters[i].Name, StringComparison.OrdinalIgnoreCase)) 581if (updatedDefaults != null && updatedDefaults.TryGetValue(parameter.Name, out var newDefault)) 585var message = Resources.FormatTemplateRoute_CannotHaveDefaultValueSpecifiedInlineAndExplicitly(parameter.Name); 605updatedDefaults[parameter.Name] = parameter.Default; 609if ((parameterPolicyReferences == null || !parameterPolicyReferences.TryGetValue(parameter.Name, out parameterConstraints)) && 618parameterPolicyReferences.Add(parameter.Name, parameterConstraints); 635parameter.Name, 1076if (!parameterNameSet.Add(parameterPart.Name)) 1078var errorText = Resources.FormatTemplateRoute_RepeatedParameter(parameterPart.Name);
Patterns\RoutePatternMatcher.cs (8)
51if (Defaults.TryGetValue(parameter.Name, out var value)) 179if (defaultValue != null || !values.ContainsKey(parameter.Name)) 181values[parameter.Name] = defaultValue; 255values[parameter.Name] = captured; 260values[parameter.Name] = _defaultValues[index]; 273values[parameter.Name] = requestSegment.ToString(); 279values[parameter.Name] = _defaultValues[index]; 474outValues.Add(parameterNeedsValue.Name, new string(parameterValueSpan));
Patterns\RoutePatternParameterPart.cs (1)
97builder.Append(Name);
Patterns\RoutePatternParser.cs (4)
233var parameterName = templatePart.Name; 372parameter.Name, 385parameter.Name, 401parameter.Name,
RouteEndpointDataSource.cs (1)
287yield return routePatternPart.Name;
Template\RoutePrecedence.cs (1)
266if (routePattern.RequiredValues.TryGetValue(parameterPart.Name, out var requiredValue) &&
Template\TemplateBinder.cs (7)
86filters.Remove(pattern.Parameters[i].Name); 118filters.Remove(pattern.Parameters[i].Name); 282_defaults?.ContainsKey(parameter.Name) != true) 339else if (_defaults != null && _defaults.TryGetValue(parameter.Name, out var defaultValue)) 544acceptedValues.Remove(parameterPart.Name, out var value); 548_defaults.TryGetValue(parameterPart.Name, out var defaultValue) && 726slots[i] = new KeyValuePair<string, object?>(pattern.Parameters[i].Name, null);
Template\TemplatePart.cs (1)
40Name = parameter.Name;
Microsoft.AspNetCore.Routing.Microbenchmarks (2)
src\Http\Routing\test\UnitTests\Matching\RouteMatcherBuilder.cs (1)
58defaults.Remove(parameter.Name);
src\Http\Routing\test\UnitTests\Matching\TreeRouterMatcherBuilder.cs (1)
62defaults.Remove(parameter.Name);
Microsoft.AspNetCore.Routing.Tests (95)
Matching\RouteMatcherBuilder.cs (1)
58defaults.Remove(parameter.Name);
Matching\TreeRouterMatcherBuilder.cs (1)
62defaults.Remove(parameter.Name);
Patterns\InlineRouteParameterParserTest.cs (75)
17Assert.Equal(parameterName, templatePart.Name); 29Assert.Equal("param", templatePart.Name); 41Assert.Equal("param", templatePart.Name); 53Assert.Equal("param", templatePart.Name); 65Assert.Equal("param", templatePart.Name); 77Assert.Equal("param", templatePart.Name); 91Assert.Equal("param", templatePart.Name); 105Assert.Equal("param", templatePart.Name); 119Assert.Equal("param", templatePart.Name); 134Assert.Equal("param", templatePart.Name); 149Assert.Equal("param", templatePart.Name); 163Assert.Equal("param", templatePart.Name); 179Assert.Equal("param", templatePart.Name); 193Assert.Equal("param", templatePart.Name); 208Assert.Equal("param", templatePart.Name); 222Assert.Equal("param", templatePart.Name); 238Assert.Equal("param", templatePart.Name); 258Assert.Equal("comparison-operator", templatePart.Name); 275Assert.Equal("p1", param1.Name); 285Assert.Equal("p2", param2.Name); 290Assert.Equal("p3", param3.Name); 301Assert.Equal("world", templatePart.Name); 311Assert.Equal("param", templatePart.Name); 322Assert.Equal("param", templatePart.Name); 335Assert.Equal("param", templatePart.Name); 350Assert.Equal("param", templatePart.Name); 363Assert.Equal("param", templatePart.Name); 378Assert.Equal("param", templatePart.Name); 391Assert.Equal("param", templatePart.Name); 406Assert.Equal("param", templatePart.Name); 419Assert.Equal(":param", templatePart.Name); 434Assert.Equal(":param", templatePart.Name); 450Assert.Equal(":param", templatePart.Name); 464Assert.Equal("param", templatePart.Name); 477Assert.Equal("par,am", templatePart.Name); 490Assert.Equal("param", templatePart.Name); 505Assert.Equal("param", templatePart.Name); 521Assert.Equal("param", templatePart.Name); 535Assert.Equal("param", templatePart.Name); 546Assert.Equal("param", templatePart.Name); 560Assert.Equal("param", templatePart.Name); 574Assert.Equal("par", templatePart.Name); 585Assert.Equal("param", templatePart.Name); 596Assert.Equal("par", templatePart.Name); 607Assert.Equal("par", templatePart.Name); 618Assert.Equal("param", templatePart.Name); 632Assert.Equal("param", templatePart.Name); 645Assert.Equal("par{am", templatePart.Name); 658Assert.Equal("param", templatePart.Name); 673Assert.Equal("par(am", templatePart.Name); 686Assert.Equal("param", templatePart.Name); 699Assert.Equal("param", templatePart.Name); 712Assert.Equal("param", templatePart.Name); 726Assert.Equal("param", templatePart.Name); 742Assert.Equal("param", templatePart.Name); 756Assert.Equal("param", templatePart.Name); 771Assert.Equal("param", templatePart.Name); 786Assert.Equal("param", templatePart.Name); 801Assert.Equal("param", templatePart.Name); 816Assert.Equal("param", templatePart.Name); 831Assert.Equal("par?am", templatePart.Name); 846Assert.Equal("param", templatePart.Name); 862Assert.Equal("param", templatePart.Name); 877Assert.Equal("foo", templatePart.Name); 892Assert.Equal("p1", templatePart.Name); 907Assert.Equal("p1", templatePart.Name); 932Assert.Equal(expectedParameterName, templatePart.Name); 944Assert.Equal("path", parameterPart.Name); 957Assert.Equal("path", parameterPart.Name); 975Assert.Equal("path", parameterPart.Name); 993Assert.Equal("path", parameterPart.Name); 1010Assert.Equal("path", parameterPart.Name); 1022Assert.Equal("path", parameterPart.Name); 1039Assert.Equal("path", parameterPart.Name); 1056Assert.Equal("path", parameterPart.Name);
Patterns\RoutePatternFactoryTest.cs (12)
484Assert.Equal(paramPartB.Name, actual.Parameters[0].Name); 488Assert.Equal(paramPartC.Name, actual.Parameters[1].Name); 492Assert.Equal(paramPartD.Name, actual.Parameters[2].Name); 524Assert.Equal(paramPartB.Name, actual.Parameters[0].Name); 528Assert.Equal(paramPartC.Name, actual.Parameters[1].Name); 532Assert.Equal(paramPartD.Name, actual.Parameters[2].Name);
Patterns\RoutePatternParserTest.cs (2)
729x.Name == y.Name &&
Template\TemplateSegmentTest.cs (4)
38Assert.Equal(paramPartC.Name, ((RoutePatternParameterPart)routePatternPathSegment.Parts[0]).Name); 44Assert.Equal(paramPartB.Name, ((RoutePatternParameterPart)routePatternPathSegment.Parts[3]).Name);