79245274

Date: 2024-12-02 19:08:38
Score: 2.5
Natty:
Report link

Use the Context object in the hub to get the ASP.Net Core Identity UserId.

var userId = Context.UserIdentifier;

https://learn.microsoft.com/en-us/aspnet/core/signalr/hubs?view=aspnetcore-9.0#the-context-object:~:text=before%20SendAsync%20finishes.-,The%20Context%20object,-The%20Hub%20class

Reasons:
  • Probably link only (1):
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Rodrygo