User383393697 posted
HI, I'm learning C# and to do that I am building a text based RPG using Signalr. I can create a player and save the data as a JSON file. But what I want to do is store that data in a dictionary using the Connection ID as the key. This way any action on the
player data I can get it from the Dictionary and not re-read the JSON file every time.
I created a dictionary to do this and also used the singleton pattern to do it. When I run the code the player info gets stored in the dictionary. I then call another method to retrieve the data but the dictionary is now null.
I'm really confused as to how? It's like every call to the hub creates a new instance. How can I store this data in memory?
Thanks.