Skip to content

Commit 5600941

Browse files
committed
Add long incrementBy to HINCRBY
1 parent 5d9830e commit 5600941

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/ServiceStack.Redis/RedisClient_Hash.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,17 @@ public void SetRangeInHash(string hashId, IEnumerable<KeyValuePair<string, strin
7676
base.HMSet(hashId, keys, values);
7777
}
7878

79-
public int IncrementValueInHash(string hashId, string key, int incrementBy)
80-
{
81-
return base.HIncrby(hashId, key.ToUtf8Bytes(), incrementBy);
82-
}
79+
public int IncrementValueInHash(string hashId, string key, int incrementBy)
80+
{
81+
return base.HIncrby(hashId, key.ToUtf8Bytes(), incrementBy);
82+
}
83+
84+
public int IncrementValueInHash(string hashId, string key, long incrementBy)
85+
{
86+
return base.HIncrby(hashId, key.ToUtf8Bytes(), incrementBy);
87+
}
8388

84-
public string GetValueFromHash(string hashId, string key)
89+
public string GetValueFromHash(string hashId, string key)
8590
{
8691
return base.HGet(hashId, key.ToUtf8Bytes()).FromUtf8Bytes();
8792
}

src/ServiceStack.Redis/RedisNativeClient.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,6 +1374,13 @@ public int HIncrby(string hashId, byte[] key, int incrementBy)
13741374
return SendExpectInt(Commands.HIncrBy, hashId.ToUtf8Bytes(), key, incrementBy.ToString().ToUtf8Bytes());
13751375
}
13761376

1377+
public int HIncrby(string hashId, byte[] key, long incrementBy)
1378+
{
1379+
AssertHashIdAndKey(hashId, key);
1380+
1381+
return SendExpectInt(Commands.HIncrBy, hashId.ToUtf8Bytes(), key, incrementBy.ToString().ToUtf8Bytes());
1382+
}
1383+
13771384
public double HIncrbyFloat(string hashId, byte[] key, double incrementBy)
13781385
{
13791386
AssertHashIdAndKey(hashId, key);

0 commit comments

Comments
 (0)