1. Create a new console program and create a new class of "UserInfo"
2. Download the Redis Windows service https://github.com/ServiceStack/redis-windows download from GitHub, and get a different version of the package, here I choose the latest 3.0
The DOS interface appears after startup, because the configuration file is not set, so the default settings are used, like this
3. Now back to Visual Studio
Add a reference to the project from NuGet
After the installation, we can start our code.
4. We have a userinfo class with 2 attribute int IDs and string Name,
You can then simulate the session.
About the use of the above is I watched the Servicestack team (well, do not know what to call, in short is the official right) on GitHub on the code, put the address, interested can study
Https://github.com/ServiceStack/ServiceStack.Redis/blob/master/tests/ServiceStack.Redis.Tests/RedisClientHashTests.cs
The simple use of redis is over, there is a chance to study the master-slave copy of the writing, if you have help on the point of Praise Bai
C # Redis stored session hash object