// 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 Microsoft.AspNetCore.Sockets; namespace Microsoft.Extensions.DependencyInjection { public static class EndpointDependencyInjectionExtensions { public static IServiceCollection AddEndPoint(this IServiceCollection services) where TEndPoint : EndPoint { services.AddSingleton(); return services; } public static IServiceCollection AddEndPoint(this IServiceCollection services, Action> setupAction) where TEndPoint : EndPoint { services.AddEndPoint(); services.Configure(setupAction); return services; } } }