BB.Caching.Cache.Shared.Hashes.SetIfNotExistsAsync C# (CSharp) Метод

SetIfNotExistsAsync() публичный статический Метод

Sets field in the hash stored at key to value, only if field does not yet exist. If key does not exist, a new key holding a hash is created. If field already exists, this operation has no effect.
http://redis.io/commands/hsetnx
public static SetIfNotExistsAsync ( RedisKey key, RedisValue field, RedisValue value ) : Task
key RedisKey /// The key. ///
field RedisValue /// The field. ///
value RedisValue /// The value. ///
Результат Task
                public static Task<bool> SetIfNotExistsAsync(RedisKey key, RedisValue field, RedisValue value)
                {
                    Task<bool> result = SharedCache.Instance.GetWriteConnection(key)
                        .GetDatabase(SharedCache.Instance.Db)
                        .HashSetAsync(key, field, value, When.NotExists);

                    return result;
                }
            }