Beispiel #1
0
 public static ValueTask <bool> Set <T>(this IRedisCommands redis, string key, T value, OptimisticConcurrency concurrency)
 {
     return(redis.Set(key, value, null, concurrency));
 }
Beispiel #2
0
        public static async ValueTask <T> GetOrDefault <T>(this IRedisCommands redis, string key, T defaultValue = default)
        {
            var result = await redis.Get <T>(key);

            return(result.HasValue ? result.Value : defaultValue);
        }