using System; using Microsoft.AspNetCore.SignalR; using Microsoft.Extensions.DependencyInjection; using xPushService.Interfaces; namespace xPushService.Providers { public class XHubContextFactory : IXHubContextFactory { private readonly IServiceProvider services; public XHubContextFactory(IServiceProvider services) { this.services = services; } public IHubContext Create() where THub : Hub { return services.GetRequiredService>(); } } }