Files
xPushService/Providers/XHubContextFactory.cs
T
2026-05-16 01:14:19 +03:30

23 lines
571 B
C#

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<THub> Create<THub>()
where THub : Hub
{
return services.GetRequiredService<IHubContext<THub>>();
}
}
}