You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
752 B
25 lines
752 B
using Microsoft.AspNetCore.Routing;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace Kean.Infrastructure.SignalR
|
|
{
|
|
/// <summary>
|
|
/// EndpointRouteBuilder 扩展方法
|
|
/// </summary>
|
|
public static class EndpointRouteBuilderExtensions
|
|
{
|
|
/// <summary>
|
|
/// 映射 Soap 路径
|
|
/// </summary>
|
|
/// <param name="endpoints">终节点路由</param>
|
|
/// <returns>终节点路由</returns>
|
|
public static IEndpointRouteBuilder MapHubs(this IEndpointRouteBuilder endpoints)
|
|
{
|
|
foreach (var item in endpoints.ServiceProvider.GetService<HubCollection>())
|
|
{
|
|
item.Map(endpoints);
|
|
}
|
|
return endpoints;
|
|
}
|
|
}
|
|
}
|