コード例 #1
0
ファイル: RedisMutiKey.cs プロジェクト: zwq00000/Redis.Net
        /// <summary>
        /// 重建索引,
        /// </summary>
        /// 该方法根据 <see cref="BaseKey"/> 查找以 {BaseKey}开头的键
        /// 删除当前集合索引并加入所有以 {BaseKey}开头的键(不包括 索引集合键)
        /// <returns></returns>
        public async Task RebuildIndexAsync(Func <string, TKey> convert)
        {
            var entityKeys = ResolveEntiyKeys().Select(k => convert(k));
            await _indexSet.DeleteAsync();

            await _indexSet.AddAsync(entityKeys.ToArray());
        }
コード例 #2
0
        public async Task TestAddAsync()
        {
            await _set.AddAsync("Test2");

            Assert.Contains("Test2", _set.Values);
        }