// 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 Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Primitives; namespace Microsoft.AspNetCore.Routing { public class DefaultEndpointDataSource : EndpointDataSource { private readonly List _endpoints; public DefaultEndpointDataSource(IEnumerable endpoints) { if (endpoints == null) { throw new ArgumentNullException(nameof(endpoints)); } _endpoints = new List(); _endpoints.AddRange(endpoints); } public override IChangeToken GetChangeToken() => NullChangeToken.Singleton; public override IReadOnlyList Endpoints => _endpoints; } }