// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Http;
namespace Microsoft.AspNetCore.Routing
{
///
/// Defines the contract that a class must implement in order to check whether a URL parameter
/// value is valid for a constraint.
///
public interface IRouteConstraint : IParameterPolicy
{
///
/// Determines whether the URL parameter contains a valid value for this constraint.
///
/// An object that encapsulates information about the HTTP request.
/// The router that this constraint belongs to.
/// The name of the parameter that is being checked.
/// A dictionary that contains the parameters for the URL.
///
/// An object that indicates whether the constraint check is being performed
/// when an incoming request is being handled or when a URL is being generated.
///
/// true if the URL parameter contains a valid value; otherwise, false.
bool Match(
HttpContext httpContext,
IRouter route,
string routeKey,
RouteValueDictionary values,
RouteDirection routeDirection);
}
}