DaLi.Utils.Redis 3.24.12.2101

There is a newer version of this package available.
See the version list below for details.
dotnet add package DaLi.Utils.Redis --version 3.24.12.2101
                    
NuGet\Install-Package DaLi.Utils.Redis -Version 3.24.12.2101
                    
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="DaLi.Utils.Redis" Version="3.24.12.2101" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DaLi.Utils.Redis" Version="3.24.12.2101" />
                    
Directory.Packages.props
<PackageReference Include="DaLi.Utils.Redis" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DaLi.Utils.Redis --version 3.24.12.2101
                    
#r "nuget: DaLi.Utils.Redis, 3.24.12.2101"
                    
#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.
#:package DaLi.Utils.Redis@3.24.12.2101
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DaLi.Utils.Redis&version=3.24.12.2101
                    
Install as a Cake Addin
#tool nuget:?package=DaLi.Utils.Redis&version=3.24.12.2101
                    
Install as a Cake Tool

DaLi.Utils.Redis

基于 FreeRedis 的 Redis 工具库,提供了更易用的 Redis 数据操作接口。

功能特性

  • 支持 Redis JSON 模块,提供对象化的 JSON 数据操作
  • 支持 Redis Hash 表操作
  • 提供基于 Redis 的索引功能
    • 支持标签索引
    • 支持字典数据索引
  • 支持状态缓存操作
  • 支持大小写敏感/不敏感设置

依赖要求

  • .NET 8.0+
  • Redis 服务器需安装 RedisJSON 模块

快速开始

  1. 安装 NuGet 包:
dotnet add package DaLi.Utils.Redis
  1. 基本用法示例:
' 创建 Redis 客户端
Dim client As New RedisClient("localhost:6379")

' JSON 操作
Dim json As New RedisJson(client, "test-json")
json.Set("$.name", "test")
json.Get(Of String)("$.name") ' 返回 "test"

' Hash 表操作  
Dim hash As New RedisHash(Of String)(client, "test-hash") 
hash("key") = "value"
hash.Get("key") ' 返回 "value"

' 标签索引
Class TagIndex 
    Inherits TagIndexBase(Of Entity, Integer)
    
    Protected Overrides Function GetID(entity As Entity) As Integer
        Return entity.Id
    End Function
    
    Protected Overrides Function GetTags(entity As Entity) As String()
        Return entity.Tags
    End Function
End Class

' 状态缓存
Dim cache As New StatusCache(Of String)(client, "test-status")
cache.SET("key", "value")

主要类说明

  • RedisJson - Redis JSON 数据操作
  • RedisHash - Redis Hash 表操作
  • IndexBase - 索引基类
  • TagIndexBase - 标签索引基类
  • DictionaryIndexBase - 字典数据索引基类
  • StatusCache - 状态缓存操作

许可证

本项目基于 Mulan PSL v2 开源协议。

关于

由湖南大沥网络科技有限公司开发和维护。

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DaLi.Utils.Redis:

Package Downloads
DaLi.Utils.App

大沥网络 · 公共库

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.25.5.1117 147 5/11/2025
3.24.12.2101 125 12/20/2024
3.24.11.2612 138 11/26/2024
3.24.8.1909 192 8/19/2024
3.24.8.617 136 8/6/2024
3.24.8.210 126 8/2/2024
3.24.8.122 136 8/1/2024
3.24.7.2315 172 7/23/2024
3.24.7.1621 165 7/16/2024
3.24.7.1516 158 7/15/2024