Follow ups for nullable (#23736)
* Follow ups for nullable * Update src/Http/Routing/src/Matching/DfaMatcherBuilder.cs Co-authored-by: James Newton-King <james@newtonking.com> Co-authored-by: James Newton-King <james@newtonking.com>
This commit is contained in:
parent
380a5679bb
commit
93634cd772
|
|
@ -247,7 +247,9 @@ namespace Microsoft.AspNetCore.Routing.Matching
|
|||
}
|
||||
}
|
||||
|
||||
AddLiteralNode(includeLabel, nextParents, parent, requiredValue.ToString());
|
||||
var literalValue = requiredValue?.ToString() ?? throw new InvalidOperationException($"Required value for literal '{parameterPart.Name}' must evaluate to a non-null string.");
|
||||
|
||||
AddLiteralNode(includeLabel, nextParents, parent, literalValue);
|
||||
}
|
||||
else if (segment.IsSimple && parameterPart != null)
|
||||
{
|
||||
|
|
@ -353,7 +355,7 @@ namespace Microsoft.AspNetCore.Routing.Matching
|
|||
if (segment is null)
|
||||
{
|
||||
// Treat "no segment" as high priority. it won't effect the algorithm, but we need to define a sort-order.
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return RoutePrecedence.ComputeInboundPrecedenceDigit(endpoint.RoutePattern, segment);
|
||||
|
|
@ -741,7 +743,7 @@ namespace Microsoft.AspNetCore.Routing.Matching
|
|||
{
|
||||
var nodeBuilder = _nodeBuilders[i];
|
||||
|
||||
// Build a list of each
|
||||
// Build a list of each
|
||||
List<DfaNode> nextWork;
|
||||
if (previousWork == null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,6 +51,11 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
throw new ArgumentNullException(nameof(services));
|
||||
}
|
||||
|
||||
if (configure == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(configure));
|
||||
}
|
||||
|
||||
services.Configure(configure);
|
||||
return services.AddAuthorizationCore();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue