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,730
  • 17
  • 111
  • 169

1 Answers1

3

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

Răzvan Flavius Panda
  • 21,730
  • 17
  • 111
  • 169