Skip to content

Commit e0e3999

Browse files
committed
initial commit
0 parents  commit e0e3999

File tree

163 files changed

+11344
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+11344
-0
lines changed

.vscode/launch.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": ".NET Core Launch (console)",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"preLaunchTask": "build",
12+
"program": "${workspaceFolder}/tests/RediSharp.Tests/bin/Debug/net6.0/RediSharp.Tests.dll",
13+
"args": [],
14+
"cwd": "${workspaceFolder}/tests/RediSharp.Tests",
15+
"console": "internalConsole",
16+
"stopAtEntry": false
17+
},
18+
{
19+
"name": ".NET Core Attach",
20+
"type": "coreclr",
21+
"request": "attach"
22+
}
23+
]
24+
}

.vscode/tasks.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/tests/RediSharp.Tests/RediSharp.Tests.csproj",
11+
"/property:GenerateFullPaths=true",
12+
"/consoleloggerparameters:NoSummary"
13+
],
14+
"problemMatcher": "$msCompile"
15+
},
16+
{
17+
"label": "publish",
18+
"command": "dotnet",
19+
"type": "process",
20+
"args": [
21+
"publish",
22+
"${workspaceFolder}/tests/RediSharp.Tests/RediSharp.Tests.csproj",
23+
"/property:GenerateFullPaths=true",
24+
"/consoleloggerparameters:NoSummary"
25+
],
26+
"problemMatcher": "$msCompile"
27+
},
28+
{
29+
"label": "watch",
30+
"command": "dotnet",
31+
"type": "process",
32+
"args": [
33+
"watch",
34+
"run",
35+
"--project",
36+
"${workspaceFolder}/tests/RediSharp.Tests/RediSharp.Tests.csproj"
37+
],
38+
"problemMatcher": "$msCompile"
39+
}
40+
]
41+
}

src/RediSharp.Core/Connection.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using StackExchange.Redis;
2+
namespace RediSharp.Core
3+
{
4+
public static class Connection
5+
{
6+
// ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost");
7+
// IDatabase db = redis.GetDatabase();
8+
9+
10+
11+
}
12+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="StackExchange.Redis" Version="2.6.45" />
11+
</ItemGroup>
12+
13+
</Project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using StackExchange.Redis;
2+
using System.Text.Json;
3+
using System.Text.Json.Serialization;
4+
namespace RediSharp.Core;
5+
6+
public static class RedisJsonCommands
7+
{
8+
private static readonly JsonSerializerOptions Options = new()
9+
{
10+
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
11+
};
12+
public static RedisResult JsonSet(this IDatabase db, string key, string path, object obj)
13+
{
14+
var json = JsonSerializer.Serialize(obj);
15+
var result = db.Execute("JSON.SET", key, path, json);
16+
return result;
17+
}
18+
}

0 commit comments

Comments
 (0)