NewLife.Redis.Core 1.5.2022.1214

There is a newer version of this package available.
See the version list below for details.
dotnet add package NewLife.Redis.Core --version 1.5.2022.1214                
NuGet\Install-Package NewLife.Redis.Core -Version 1.5.2022.1214                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NewLife.Redis.Core" Version="1.5.2022.1214" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NewLife.Redis.Core --version 1.5.2022.1214                
#r "nuget: NewLife.Redis.Core, 1.5.2022.1214"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NewLife.Redis.Core as a Cake Addin
#addin nuget:?package=NewLife.Redis.Core&version=1.5.2022.1214

// Install NewLife.Redis.Core as a Cake Tool
#tool nuget:?package=NewLife.Redis.Core&version=1.5.2022.1214                

NewLife.Redis.Core

<h1>一、项目说明</h1> <p>NewLife.Redis.Core基于新生命团队NewLife.Redis的封装,支持.NETCore3/.NET5/.NET6/.NET7。</p> <p dir="auto"><span style="color: #e03e2d;">NewLife.Redis</span> 是一个Redis客户端组件,以高性能处理大数据实时计算为目标。</p> <p dir="auto">源码: <a href="https://github.com/NewLifeX/NewLife.Redis">https://github.com/NewLifeX/NewLife.Redis</a><br />Nuget:NewLife.Redis<br />教程:<a href="https://newlifex.com/core/redis" rel="nofollow">https://newlifex.com/core/redis</a></p> <h1>二、使用说明</h1> <h2>2.1 通过New的方式安装使用</h2>

using NewLife.Redis.Core;

NewLifeRedis redis = new NewLifeRedis("server=127.0.0.1:6379;password=xxx;db=4");

//普通操作
redis.Set("test", "1");
Console.WriteLine(redis.Get<string>("test"));

//列表
redis.ListAdd("listtest", 1);
redis.ListGetAll<string>("listtest");

//SortedSet
redis.SortedSetAdd("sortsettest", "1", 1.0);
redis.SortedSetIncrement("sortsettest", "1", 1.0);


//set
redis.SetAdd("settest", "2");

//哈希
redis.HashAdd("hashtest", "1", "2");
redis.HashGet<string>("hashtest", new string[] { "1" });


//队列操作
//方式1
var queue = redis.GetRedisQueue<string>("queue");
queue.Add("test");
var data = queue.Take(1);
//方式2
redis.AddQueue("queue", "1");
redis.GetQueueOne<string>("queue");

<h2>2.2 通过IOC注入</h2> <p>ConfigureServices里注册组件</p>

        //默认读取配置文件:ConnectionStrings:Redis
        services.AddRedisCacheManager();

        //指定链接字符串
        services.AddRedisCacheManager("server=127.0.0.1:6379;password=xxx;db=4");

<p>构造函数里注入IRedisCacheManager</p>

        private readonly ILogger<Worker> _logger;
        private readonly IRedisCacheManager _redisCacheManager;

        public Worker(ILogger<Worker> logger, IRedisCacheManager redisCacheManager)
        {
            _logger = logger;
            this._redisCacheManager = redisCacheManager;

            var data = _redisCacheManager.Get<string>("test");
        }
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.9.2023.1211 2,125 12/11/2023
1.9.2023.1205 170 12/5/2023
1.8.2023.918 504 9/18/2023
1.8.2023.830 237 9/8/2023
1.8.2023.421 2,543 4/21/2023
1.7.2022.1220 3,147 12/20/2022
1.6.2022.1219 336 12/19/2022
1.5.2022.1214 397 12/14/2022
1.4.2022.1213 322 12/13/2022
1.3.2022.1213 304 12/13/2022
1.2.2022.1115 504 11/15/2022
1.2.2022.1111 378 11/11/2022
1.2.2022.1018 475 10/18/2022
1.2.2022.901 589 9/1/2022
1.2.2022.822 420 8/22/2022
1.2.2022.720 736 7/20/2022
1.1.2022.720 443 7/20/2022