Preparing xPushService ...
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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>>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user