Last post Dec 03, 2014 10:03 PM by Kevin Shen - MSFT
Dec 02, 2014 08:10 PM|VirtualLife|LINK
Looking at examples like: http://www.asp.net/signalr/overview/guide-to-the-api/mapping-users-to-connections
It shows the ability to get the context.user in the OnConnected method, yet mine is always null. Everything else works fine.
What I want to do is save the Context.ConnectionId and Context.user.Identity.Name to the database when connected.
Am I doing something wrong or missing something to be able to get the user context at that point, or is there a better place to set/save it to the db?
Secondary ?, when it returns base.OnConnected, not sure where that's returning to, can that be overridden to maybe get the context there to save it?
On a side note, I am running this as a self host and also tried as a service if that matters. The ConnectionId populates fine, just not the Context.User.
Dec 03, 2014 10:03 PM|Kevin Shen - MSFT|LINK
First，please chek if you have you tried to add the code below to your startup class
Second ,here is similar issue whihc may give you a rigth direction:
Last ,According to the documentation in Signarl, base.OnConnected return the Task,it seemst that is not related with the context