diff --git a/src/Microsoft.AspNetCore.Routing/EndpointConstraints/IEndpointConstraint.cs b/src/Microsoft.AspNetCore.Routing/EndpointConstraints/IEndpointConstraint.cs index 87fc9407ad..1a71ec738d 100644 --- a/src/Microsoft.AspNetCore.Routing/EndpointConstraints/IEndpointConstraint.cs +++ b/src/Microsoft.AspNetCore.Routing/EndpointConstraints/IEndpointConstraint.cs @@ -51,7 +51,15 @@ namespace Microsoft.AspNetCore.Routing.EndpointConstraints Endpoint endpoint, IReadOnlyList constraints) { - throw new NotSupportedException(); + if (endpoint == null) + { + throw new ArgumentNullException(nameof(endpoint)); + } + + Endpoint = endpoint; + Score = 0; + Values = null; + Constraints = constraints; } public Endpoint Endpoint { get; }