C # Redis stored session hash object

Source: Internet
Author: User
Tags redis windows windows download

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.