// 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 System; using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing.Patterns; namespace Microsoft.AspNetCore.Routing.Matching { public sealed class MatcherEndpoint : Endpoint { internal static readonly Func EmptyInvoker = (next) => { return (context) => Task.CompletedTask; }; public MatcherEndpoint( Func invoker, RoutePattern routePattern, int order, EndpointMetadataCollection metadata, string displayName) : base(metadata, displayName) { if (invoker == null) { throw new ArgumentNullException(nameof(invoker)); } if (routePattern == null) { throw new ArgumentNullException(nameof(routePattern)); } Invoker = invoker; RoutePattern = routePattern; Order = order; } public Func Invoker { get; } public int Order { get; } public RoutePattern RoutePattern { get; } } }