2

I'm trying to map SignalR Users to connections using IUserIdProvider as mentioned in this answer: https://stackoverflow.com/a/21355406/750216

How can I run GlobalHost.DependencyResolver.Register(typeof(IUserIdProvider), () => idProvider); inside Startup.Configure(...)?

The issue is that GlobalHost is no longer available in SignalR core and I don't think it is possible to inject a IHubContext service into Startup class

Răzvan Flavius Panda
  • 21,136
  • 15
  • 108
  • 159

1 Answers1

2

The solution is to add services.AddSingleton<IUserIdProvider, CustomUserIdProvider>(); to Startup.ConfigureServices(...) instead.

Răzvan Flavius Panda
  • 21,136
  • 15
  • 108
  • 159