Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 71c4b9e

Browse files
committed
Allow null in useDb to unset connection on page
1 parent a73eb60 commit 71c4b9e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ServiceStack.Redis/RedisScripts.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ T exec<T>(Func<IRedisClient, T> fn, ScriptScopeContext scope, object options)
6060

6161
public IgnoreResult useRedis(ScriptScopeContext scope, string redisConnection)
6262
{
63-
scope.PageResult.Args[RedisConnection] = redisConnection;
63+
if (redisConnection == null)
64+
scope.PageResult.Args.Remove(RedisConnection);
65+
else
66+
scope.PageResult.Args[RedisConnection] = redisConnection;
67+
6468
return IgnoreResult.Value;
6569
}
6670

0 commit comments

Comments
 (0)