File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed
src/Caching/StackExchangeRedis/src Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -9,31 +9,19 @@ namespace Microsoft.Extensions.Caching.StackExchangeRedis
9
9
{
10
10
internal static class RedisExtensions
11
11
{
12
- private const string HmGetScript = ( @"return redis.call('HMGET', KEYS[1], unpack(ARGV))" ) ;
13
-
14
12
internal static RedisValue [ ] HashMemberGet ( this IDatabase cache , string key , params string [ ] members )
15
13
{
16
- var result = cache . ScriptEvaluate (
17
- HmGetScript ,
18
- new RedisKey [ ] { key } ,
19
- GetRedisMembers ( members ) ) ;
20
-
21
14
// TODO: Error checking?
22
- return ( RedisValue [ ] ) result ;
15
+ return cache . HashGet ( key , GetRedisMembers ( members ) ) ;
23
16
}
24
17
25
18
internal static async Task < RedisValue [ ] > HashMemberGetAsync (
26
19
this IDatabase cache ,
27
20
string key ,
28
21
params string [ ] members )
29
22
{
30
- var result = await cache . ScriptEvaluateAsync (
31
- HmGetScript ,
32
- new RedisKey [ ] { key } ,
33
- GetRedisMembers ( members ) ) . ConfigureAwait ( false ) ;
34
-
35
23
// TODO: Error checking?
36
- return ( RedisValue [ ] ) result ;
24
+ return await cache . HashGetAsync ( key , GetRedisMembers ( members ) ) . ConfigureAwait ( false ) ;
37
25
}
38
26
39
27
private static RedisValue [ ] GetRedisMembers ( params string [ ] members )
You can’t perform that action at this time.
0 commit comments