/*
 * 由SharpDevelop创建。
 * 用户： Administrator
 * 日期: 2018-12-07
 * 时间: 15:34
 * 
 * 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
 */
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using MrWu.Debug;
using StackExchange.Redis;

namespace Server.DB.Redis {
    /*
	 * CommandFlags
	 * None = 0;	//默认行为
	 * HighPriority = 1;	//不用了，废弃
	 * FireAndForget = 2;   //对结果不感兴趣，调用者将会立即收到默认值
	 * PreferMaster = 0;    //如果主服务器可用，则应在主服务器上执行此操作，但可以执行读操作
	 * DemandMaster = 4;    //此操作只应在[主站]上执行
	 * PreferSlave = 8;		//如果可用，则应在[从站]上执行此操作，但将在其上执行
	 * DemandSlave = 12;	//此操作只应在[从站]上执行。 仅适用于读取操作。
	 * NoRedirect = 64;		//表示由于ASK或MOVED响应，不应将此操作转发到其他服务器
	 * NoScriptCache = 512  //表示与脚本相关的操作应使用EVAL，而不是SCRIPT LOAD + EVALSHA
	 * */

    /*
	 * When
	 * Always: 一直
	 * Exists: 当key存在时才生效
	 * NotExists: 当key不存在时才生效
	 * 
	 * */


    /// <summary>
    /// IDatabase 代理
    /// </summary>
    public partial class IDatabaseProxy {

        private IDatabase db;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="db"></param>
        public IDatabaseProxy(IDatabase db) {
            this.db = db;
        }

        /// <summary>
        /// 循环超时数量
        /// </summary>
        private const int loopOutCnt = 3;

        private T FDBOpera<T, K1>(Func<K1, T> func, K1 param1) {
            int cnt = 0;
            while(true) {
                try {
                    return func(param1);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private T FDBOpera<T, K1, K2>(Func<K1, K2, T> func, K1 param1, K2 param2) {
            int cnt = 0;
            while(true) {
                try {
                    return func(param1, param2);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private T FDBOpera<T, K1, K2, K3>(Func<K1, K2, K3, T> func, K1 param1, K2 param2, K3 param3) {
            int cnt = 0;
            while(true) {
                try {
                    return func(param1, param2, param3);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private T FDBOpera<T, K1, K2, K3, K4>(Func<K1, K2, K3, K4, T> func, K1 param1, K2 param2, K3 param3, K4 param4) {
            int cnt = 0;
            while(true) {
                try {
                    return func(param1, param2, param3, param4);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private T FDBOpera<T, K1, K2, K3, K4, K5>(Func<K1, K2, K3, K4, K5, T> func, K1 param1, K2 param2, K3 param3, K4 param4, K5 param5) {
            int cnt = 0;
            while(true) {
                try {
                    return func(param1, param2, param3, param4, param5);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private T FDBOpera<T, K1, K2, K3, K4, K5, K6>(Func<K1, K2, K3, K4, K5, K6, T> func, K1 param1, K2 param2, K3 param3, K4 param4, K5 param5, K6 param6) {
            int cnt = 0;
            while(true) {
                try {
                    return func(param1, param2, param3, param4, param5, param6);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private T FDBOpera<T, K1, K2, K3, K4, K5, K6, K7>(Func<K1, K2, K3, K4, K5, K6, K7, T> func, K1 param1, K2 param2, K3 param3, K4 param4, K5 param5, K6 param6, K7 param7) {
            int cnt = 0;
            while(true) {
                try {
                    return func(param1, param2, param3, param4, param5, param6, param7);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private T FDBOpera<T, K1, K2, K3, K4, K5, K6, K7, K8>(Func<K1, K2, K3, K4, K5, K6, K7, K8, T> func, K1 param1, K2 param2, K3 param3, K4 param4, K5 param5, K6 param6, K7 param7, K8 param8) {
            int cnt = 0;
            while(true) {
                try {
                    return func(param1, param2, param3, param4, param5, param6, param7, param8);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private T FDBOpera<T, K1, K2, K3, K4, K5, K6, K7, K8, K9>(Func<K1, K2, K3, K4, K5, K6, K7, K8, K9, T> func, K1 param1, K2 param2, K3 param3, K4 param4, K5 param5, K6 param6, K7 param7, K8 param8, K9 param9) {
            int cnt = 0;
            while(true) {
                try {
                    return func(param1, param2, param3, param4, param5, param6, param7, param8, param9);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private void ADBOpera<K1, K2, K3>(Action<K1, K2, K3> action, K1 param1, K2 param2, K3 param3) {
            int cnt = 0;
            while(true) {
                try {
                    action(param1, param2, param3);
                    return;
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        #region 异步重试方法

        private async Task<T> FDBOperaAsync<T, K1>(Func<K1, Task<T>> func, K1 param1) {
            int cnt = 0;
            while(true) {
                try {
                    return await func(param1);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private async Task<T> FDBOperaAsync<T, K1, K2>(Func<K1, K2, Task<T>> func, K1 param1, K2 param2) {
            int cnt = 0;
            while(true) {
                try {
                    return await func(param1, param2);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private async Task<T> FDBOperaAsync<T, K1, K2, K3>(Func<K1, K2, K3, Task<T>> func, K1 param1, K2 param2, K3 param3) {
            int cnt = 0;
            while(true) {
                try {
                    return await func(param1, param2, param3);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private async Task<T> FDBOperaAsync<T, K1, K2, K3, K4>(Func<K1, K2, K3, K4, Task<T>> func, K1 param1, K2 param2, K3 param3, K4 param4) {
            int cnt = 0;
            while(true) {
                try {
                    return await func(param1, param2, param3, param4);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private async Task<T> FDBOperaAsync<T, K1, K2, K3, K4, K5>(Func<K1, K2, K3, K4, K5, Task<T>> func, K1 param1, K2 param2, K3 param3, K4 param4, K5 param5) {
            int cnt = 0;
            while(true) {
                try {
                    return await func(param1, param2, param3, param4, param5);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private async Task<T> FDBOperaAsync<T, K1, K2, K3, K4, K5, K6>(Func<K1, K2, K3, K4, K5, K6, Task<T>> func, K1 param1, K2 param2, K3 param3, K4 param4, K5 param5, K6 param6) {
            int cnt = 0;
            while(true) {
                try {
                    return await func(param1, param2, param3, param4, param5, param6);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private async Task<T> FDBOperaAsync<T, K1, K2, K3, K4, K5, K6, K7>(Func<K1, K2, K3, K4, K5, K6, K7, Task<T>> func, K1 param1, K2 param2, K3 param3, K4 param4, K5 param5, K6 param6, K7 param7) {
            int cnt = 0;
            while(true) {
                try {
                    return await func(param1, param2, param3, param4, param5, param6, param7);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private async Task<T> FDBOperaAsync<T, K1, K2, K3, K4, K5, K6, K7, K8>(Func<K1, K2, K3, K4, K5, K6, K7, K8, Task<T>> func, K1 param1, K2 param2, K3 param3, K4 param4, K5 param5, K6 param6, K7 param7, K8 param8) {
            int cnt = 0;
            while(true) {
                try {
                    return await func(param1, param2, param3, param4, param5, param6, param7, param8);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private async Task<T> FDBOperaAsync<T, K1, K2, K3, K4, K5, K6, K7, K8, K9>(Func<K1, K2, K3, K4, K5, K6, K7, K8, K9, Task<T>> func, K1 param1, K2 param2, K3 param3, K4 param4, K5 param5, K6 param6, K7 param7, K8 param8, K9 param9) {
            int cnt = 0;
            while(true) {
                try {
                    return await func(param1, param2, param3, param4, param5, param6, param7, param8, param9);
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private async Task ADBOperaAsync<K1, K2, K3>(Func<K1, K2, K3, Task> func, K1 param1, K2 param2, K3 param3) {
            int cnt = 0;
            while(true) {
                try {
                    await func(param1, param2, param3);
                    return;
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private async Task ADBOperaAsync<K1, K2, K3, K4>(Func<K1, K2, K3, K4, Task> func, K1 param1, K2 param2, K3 param3, K4 param4) {
            int cnt = 0;
            while(true) {
                try {
                    await func(param1, param2, param3, param4);
                    return;
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private async Task ADBOperaAsync<K1, K2, K3, K4, K5, K6>(Func<K1, K2, K3, K4, K5, K6, Task> func, K1 param1, K2 param2, K3 param3, K4 param4, K5 param5, K6 param6) {
            int cnt = 0;
            while(true) {
                try {
                    await func(param1, param2, param3, param4, param5, param6);
                    return;
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        #endregion

        private void ADBOpera<K1, K2, K3, K4>(Action<K1, K2, K3, K4> action, K1 param1, K2 param2, K3 param3, K4 param4) {
            int cnt = 0;
            while(true) {
                try {
                    action(param1, param2, param3, param4);
                    return;
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        private void ADBOpera<K1, K2, K3, K4, K5, K6>(Action<K1, K2, K3, K4, K5, K6> action, K1 params1, K2 params2, K3 params3, K4 params4, K5 params5, K6 params6) {
            int cnt = 0;
            while(true) {
                try {
                    action(params1, params2, params3, params4, params5, params6);
                    return;
                } catch(TimeoutException) {
                    cnt++;
                    if(cnt > loopOutCnt) {
                        Debug.Fatal("Redis 命令超时重试次数已达上限!");
                        throw;
                    }
                } catch(Exception e) {
                    Debug.Fatal("redis错误:" + e);
                    throw;
                }
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="asyncState"></param>
        /// <returns></returns>
        public IBatch CreateBatch(object asyncState = null) {
            return FDBOpera(db.CreateBatch, asyncState);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="toServer"></param>
        /// <param name="toDatabase"></param>
        /// <param name="timeoutMilliseconds"></param>
        /// <param name="migrateOptions"></param>
        /// <param name="flags"></param>
        public void KeyMigrate(RedisKey key, EndPoint toServer, int toDatabase = 0, int timeoutMilliseconds = 0, MigrateOptions migrateOptions = MigrateOptions.None, CommandFlags flags = CommandFlags.None) {
            ADBOpera(db.KeyMigrate, key, toServer, toDatabase, timeoutMilliseconds, migrateOptions, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue DebugObject(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.DebugObject, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="longitude"></param>
        /// <param name="latitude"></param>
        /// <param name="member"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool GeoAdd(RedisKey key, double longitude, double latitude, RedisValue member, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.GeoAdd, key, longitude, latitude, member, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool GeoAdd(RedisKey key, GeoEntry value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.GeoAdd, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long GeoAdd(RedisKey key, GeoEntry[] values, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.GeoAdd, key, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool GeoRemove(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.GeoRemove, key, member, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member1"></param>
        /// <param name="member2"></param>
        /// <param name="unit"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public double? GeoDistance(RedisKey key, RedisValue member1, RedisValue member2, GeoUnit unit = GeoUnit.Meters, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.GeoDistance, key, member1, member2, unit, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="members"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public string[] GeoHash(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.GeoHash, key, members, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public string GeoHash(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.GeoHash, key, member, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="members"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public GeoPosition?[] GeoPosition(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.GeoPosition, key, members, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public GeoPosition? GeoPosition(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.GeoPosition, key, member, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="radius"></param>
        /// <param name="unit"></param>
        /// <param name="count"></param>
        /// <param name="order"></param>
        /// <param name="options"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public GeoRadiusResult[] GeoRadius(RedisKey key, RedisValue member, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.GeoRadius, key, member, radius, unit, count, order, options, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="longitude"></param>
        /// <param name="latitude"></param>
        /// <param name="radius"></param>
        /// <param name="unit"></param>
        /// <param name="count"></param>
        /// <param name="order"></param>
        /// <param name="options"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public GeoRadiusResult[] GeoRadius(RedisKey key, double longitude, double latitude, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.GeoRadius, key, longitude, latitude, radius, unit, count, order, options, flags);
        }

        /// <summary>
        /// Hash中作减法运算
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long HashDecrement(RedisKey key, RedisValue hashField, long value = 1L, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashDecrement, key, hashField, value, flags);
        }

        /// <summary>
        /// Hash中作减法运算
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public double HashDecrement(RedisKey key, RedisValue hashField, double value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashDecrement, key, hashField, value, flags);
        }

        /// <summary>
        /// 删除一个Hash中的一个键
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="flags"></param>
        /// <returns>是否删除成功</returns>
        public bool HashDelete(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashDelete, key, hashField, flags);
        }

        /// <summary>
        /// 删除hash中的一些键
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashFields"></param>
        /// <param name="flags"></param>
        /// <returns>删除的数量</returns>
        public long HashDelete(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashDelete, key, hashFields, flags);
        }

        /// <summary>
        /// 某个Hash的键存在不存在
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool HashExists(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashExists, key, hashField, flags);
        }

        /// <summary>
        /// 获取某个Hash的值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue HashGet(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashGet, key, hashField, flags);
        }

        /// <summary>
        /// 获取一堆Hash的值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashFields"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue[] HashGet(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashGet, key, hashFields, flags);
        }

        /// <summary>
        /// 获取所有的Hash键值对
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public HashEntry[] HashGetAll(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashGetAll, key, flags);
        }

        /// <summary>
        /// Hash中的值做加法运算
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns>运算后的结果</returns>
        public long HashIncrement(RedisKey key, RedisValue hashField, long value = 1L, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashIncrement, key, hashField, value, flags);
        }

        /// <summary>
        /// Hash中做加法运算
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public double HashIncrement(RedisKey key, RedisValue hashField, double value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashIncrement, key, hashField, value, flags);
        }

        /// <summary>
        /// hash的所有键
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue[] HashKeys(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashKeys, key, flags);
        }

        /// <summary>
        /// Hash中的键的数量
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long HashLength(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashLength, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="pattern"></param>
        /// <param name="pageSize"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public IEnumerable<HashEntry> HashScan(RedisKey key, RedisValue pattern, int pageSize, CommandFlags flags) {
            return FDBOpera(db.HashScan, key, pattern, pageSize, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="pattern"></param>
        /// <param name="pageSize"></param>
        /// <param name="cursor"></param>
        /// <param name="pageOffset"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public IEnumerable<HashEntry> HashScan(RedisKey key, RedisValue pattern = default(RedisValue), int pageSize = 10, long cursor = 0L, int pageOffset = 0, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashScan, key, pattern, pageSize, cursor, pageOffset, flags);
        }

        /// <summary>
        /// 设置一堆键值队.
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashFields"></param>
        /// <param name="flags"></param>
        public void HashSet(RedisKey key, HashEntry[] hashFields, CommandFlags flags = CommandFlags.None) {
            ADBOpera(db.HashSet, key, hashFields, flags);
        }

        /// <summary>
        /// 设置Hash键值对
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="value"></param>
        /// <param name="when">只能使用Always以及 NoeExists 表示是是Hash的key，而非redis的key</param>
        /// <param name="flags"></param>
        /// <returns>是否设置成功</returns>
        public bool HashSet(RedisKey key, RedisValue hashField, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashSet, key, hashField, value, when, flags);
        }

        /// <summary>
        /// 获取hash的所有值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue[] HashValues(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HashValues, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool HyperLogLogAdd(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HyperLogLogAdd, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool HyperLogLogAdd(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HyperLogLogAdd, key, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long HyperLogLogLength(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HyperLogLogLength, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="keys"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long HyperLogLogLength(RedisKey[] keys, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.HyperLogLogLength, keys, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="destination"></param>
        /// <param name="first"></param>
        /// <param name="second"></param>
        /// <param name="flags"></param>
        public void HyperLogLogMerge(RedisKey destination, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) {
            ADBOpera(db.HyperLogLogMerge, destination, first, second, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="destination"></param>
        /// <param name="sourceKeys"></param>
        /// <param name="flags"></param>
        public void HyperLogLogMerge(RedisKey destination, RedisKey[] sourceKeys, CommandFlags flags = CommandFlags.None) {
            ADBOpera(db.HyperLogLogMerge, destination, sourceKeys, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public EndPoint IdentifyEndpoint(RedisKey key = default(RedisKey), CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.IdentifyEndpoint, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool KeyDelete(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.KeyDelete, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="keys"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long KeyDelete(RedisKey[] keys, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.KeyDelete, keys, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public byte[] KeyDump(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.KeyDump, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool KeyExists(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.KeyExists, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="expiry"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool KeyExpire(RedisKey key, TimeSpan? expiry, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.KeyExpire, key, expiry, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="expiry"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool KeyExpire(RedisKey key, DateTime? expiry, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.KeyExpire, key, expiry, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="database"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool KeyMove(RedisKey key, int database, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.KeyMove, key, database, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool KeyPersist(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.KeyPersist, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisKey KeyRandom(CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.KeyRandom, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="newKey"></param>
        /// <param name="when"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool KeyRename(RedisKey key, RedisKey newKey, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.KeyRename, key, newKey, when, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="expiry"></param>
        /// <param name="flags"></param>
        public void KeyRestore(RedisKey key, byte[] value, TimeSpan? expiry = null, CommandFlags flags = CommandFlags.None) {
            ADBOpera(db.KeyRestore, key, value, expiry, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public TimeSpan? KeyTimeToLive(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.KeyTimeToLive, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisType KeyType(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.KeyType, key, flags);
        }

        /// <summary>
        /// 获取列表中某个位置的元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="index"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue ListGetByIndex(RedisKey key, long index, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ListGetByIndex, key, index, flags);
        }

        /// <summary>
        /// 在pivot的后面插入一个元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="pivot"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns>插入成功返回列表总长度 插入失败返回-1</returns>
        public long ListInsertAfter(RedisKey key, RedisValue pivot, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ListInsertAfter, key, pivot, value, flags);
        }

        /// <summary>
        /// 在pivot的前面插入一个元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="pivot"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns>插入成功返回列表总长度，插入失败返回-1</returns>
        public long ListInsertBefore(RedisKey key, RedisValue pivot, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ListInsertBefore, key, pivot, value, flags);
        }

        /// <summary>
        /// 从列表的左侧取出一个值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue ListLeftPop(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ListLeftPop, key, flags);
        }

        /// <summary>
        /// 从列表的左侧插入元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="when"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long ListLeftPush(RedisKey key, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ListLeftPush, key, value, when, flags);
        }

        /// <summary>
        /// 从列表的左侧插入一堆值 顺序按数组的顺序插入
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns>返回插入后的元素个数</returns>
        public long ListLeftPush(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ListLeftPush, key, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long ListLength(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ListLength, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue[] ListRange(RedisKey key, long start = 0L, long stop = -1L, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ListRange, key, start, stop, flags);
        }

        /// <summary>
        /// 从列表中删除某个元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="count">要删除的数量</param>
        /// <param name="flags"></param>
        /// <returns>真正删除的数量</returns>
        public long ListRemove(RedisKey key, RedisValue value, long count = 0L, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ListRemove, key, value, count, flags);
        }

        /// <summary>
        /// 从列表的右侧取出一个值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue ListRightPop(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ListRightPop, key, flags);
        }

        /// <summary>
        /// 从source中的右侧取出元素 并把 元素从左侧插入到 destination
        /// </summary>
        /// <param name="source"></param>
        /// <param name="destination"></param>
        /// <param name="flags"></param>
        /// <returns>取出的元素</returns>
        public RedisValue ListRightPopLeftPush(RedisKey source, RedisKey destination, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ListRightPopLeftPush, source, destination, flags);
        }

        /// <summary>
        /// 从列表的右侧插入元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="when"></param>
        /// <param name="flags"></param>
        /// <returns>插入后的元素个数</returns>
        public long ListRightPush(RedisKey key, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ListRightPush, key, value, when, flags);
        }

        /// <summary>
        /// 从列表的右侧插入一堆元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns>插入后的元素个数</returns>
        public long ListRightPush(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) {

            return FDBOpera(db.ListRightPush, key, values, flags);
        }

        /// <summary>
        /// 设置列表中某个位置的元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="index"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        public void ListSetByIndex(RedisKey key, long index, RedisValue value, CommandFlags flags = CommandFlags.None) {
            ADBOpera(db.ListSetByIndex, key, index, value, flags);
        }

        /// <summary>
        /// 裁剪列表
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="flags"></param>
        public void ListTrim(RedisKey key, long start, long stop, CommandFlags flags = CommandFlags.None) {
            ADBOpera(db.ListTrim, key, start, stop, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="expiry"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool LockExtend(RedisKey key, RedisValue value, TimeSpan expiry, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.LockExtend, key, value, expiry, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue LockQuery(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.LockQuery, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool LockRelease(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.LockRelease, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="expiry"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool LockTake(RedisKey key, RedisValue value, TimeSpan expiry, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.LockTake, key, value, expiry, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="channel"></param>
        /// <param name="message"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long Publish(RedisChannel channel, RedisValue message, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.Publish, channel, message, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="script"></param>
        /// <param name="keys"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisResult ScriptEvaluate(string script, RedisKey[] keys = null, RedisValue[] values = null, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ScriptEvaluate, script, keys, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="hash"></param>
        /// <param name="keys"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisResult ScriptEvaluate(byte[] hash, RedisKey[] keys = null, RedisValue[] values = null, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ScriptEvaluate, hash, keys, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="script"></param>
        /// <param name="parameters"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisResult ScriptEvaluate(LuaScript script, object parameters = null, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ScriptEvaluate, script, parameters, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="script"></param>
        /// <param name="parameters"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisResult ScriptEvaluate(LoadedLuaScript script, object parameters = null, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.ScriptEvaluate, script, parameters, flags);
        }

        /// <summary>
        /// 集合添加
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns>是否添加成功</returns>
        public bool SetAdd(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetAdd, key, value, flags);
        }

        /// <summary>
        /// 集合添加
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SetAdd(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetAdd, key, values, flags);
        }

        /// <summary>
        /// 合并集合
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="first"></param>
        /// <param name="second"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue[] SetCombine(SetOperation operation, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetCombine, operation, first, second, flags);
        }

        /// <summary>
        /// 合并集合
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="keys"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue[] SetCombine(SetOperation operation, RedisKey[] keys, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetCombine, operation, keys, flags);
        }

        /// <summary>
        /// 合并集合并另存
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="destination"></param>
        /// <param name="first"></param>
        /// <param name="second"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SetCombineAndStore(SetOperation operation, RedisKey destination, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetCombineAndStore, operation, destination, first, second, flags);
        }

        /// <summary>
        /// 合并集合并另存
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="destination"></param>
        /// <param name="keys"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SetCombineAndStore(SetOperation operation, RedisKey destination, RedisKey[] keys, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetCombineAndStore, operation, destination, keys, flags);
        }

        /// <summary>
        /// 是否宝航
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool SetContains(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetContains, key, value, flags);
        }

        /// <summary>
        /// 集合元素个数
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SetLength(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetLength, key, flags);
        }

        /// <summary>
        /// 获取集合所有成员
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue[] SetMembers(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetMembers, key, flags);
        }

        /// <summary>
        /// 集合移动到另一个集合
        /// </summary>
        /// <param name="source"></param>
        /// <param name="destination"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool SetMove(RedisKey source, RedisKey destination, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetMove, source, destination, value, flags);
        }

        /// <summary>
        /// 随机取出一个元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue SetPop(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetPop, key, flags);
        }

        /// <summary>
        /// 随机返回一个元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue SetRandomMember(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetRandomMember, key, flags);
        }

        /// <summary>
        /// 随机返回count个元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="count"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue[] SetRandomMembers(RedisKey key, long count, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetRandomMembers, key, count, flags);
        }

        /// <summary>
        /// 移除一个元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool SetRemove(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetRemove, key, value, flags);
        }

        /// <summary>
        /// 移除一堆元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SetRemove(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetRemove, key, values, flags);
        }

        /// <summary>
        /// 查找元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="pattern"></param>
        /// <param name="pageSize"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public IEnumerable<RedisValue> SetScan(RedisKey key, RedisValue pattern, int pageSize, CommandFlags flags) {
            return FDBOpera(db.SetScan, key, pattern, pageSize, flags);
        }

        /// <summary>
        /// 查找
        /// </summary>
        /// <param name="key"></param>
        /// <param name="pattern"></param>
        /// <param name="pageSize"></param>
        /// <param name="cursor"></param>
        /// <param name="pageOffset"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public IEnumerable<RedisValue> SetScan(RedisKey key, RedisValue pattern = default(RedisValue), int pageSize = 10, long cursor = 0L, int pageOffset = 0, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SetScan, key, pattern, pageSize, cursor, pageOffset, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="order"></param>
        /// <param name="sortType"></param>
        /// <param name="by"></param>
        /// <param name="get"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue[] Sort(RedisKey key, long skip = 0L, long take = -1L, Order order = Order.Ascending, SortType sortType = SortType.Numeric, RedisValue by = default(RedisValue), RedisValue[] get = null, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.Sort, key, skip, take, order, sortType, by, get, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="destination"></param>
        /// <param name="key"></param>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="order"></param>
        /// <param name="sortType"></param>
        /// <param name="by"></param>
        /// <param name="get"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SortAndStore(RedisKey destination, RedisKey key, long skip = 0L, long take = -1L, Order order = Order.Ascending, SortType sortType = SortType.Numeric, RedisValue by = default(RedisValue), RedisValue[] get = null, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortAndStore, destination, key, skip, take, order, sortType, by, get, flags);
        }

        /// <summary>
        /// 添加一个元素到有序集合 如果存在则修改其对应的分值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="score"></param>
        /// <param name="flags"></param>
        /// <returns>是否添加成功</returns>
        public bool SortedSetAdd(RedisKey key, RedisValue member, double score, CommandFlags flags) {
            return FDBOpera(db.SortedSetAdd, key, member, score, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="score"></param>
        /// <param name="when"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool SortedSetAdd(RedisKey key, RedisValue member, double score, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetAdd, key, member, score, when, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SortedSetAdd(RedisKey key, SortedSetEntry[] values, CommandFlags flags) {
            return FDBOpera(db.SortedSetAdd, key, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="when"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SortedSetAdd(RedisKey key, SortedSetEntry[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetAdd, key, values, when, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="destination"></param>
        /// <param name="first"></param>
        /// <param name="second"></param>
        /// <param name="aggregate"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SortedSetCombineAndStore(SetOperation operation, RedisKey destination, RedisKey first, RedisKey second, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetCombineAndStore, operation, destination, first, second, aggregate, flags);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="destination"></param>
        /// <param name="keys"></param>
        /// <param name="weights"></param>
        /// <param name="aggregate"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SortedSetCombineAndStore(SetOperation operation, RedisKey destination, RedisKey[] keys, double[] weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetCombineAndStore, operation, destination, keys, weights, aggregate, flags);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public double SortedSetDecrement(RedisKey key, RedisValue member, double value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetDecrement, key, member, value, flags);
        }
        /// <summary>
        ///  
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public double SortedSetIncrement(RedisKey key, RedisValue member, double value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetIncrement, key, member, value, flags);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="min"></param>
        /// <param name="max"></param>
        /// <param name="exclude"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SortedSetLength(RedisKey key, double min = double.NegativeInfinity, double max = double.PositiveInfinity, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetLength, key, min, max, exclude, flags);
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="min"></param>
        /// <param name="max"></param>
        /// <param name="exclude"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SortedSetLengthByValue(RedisKey key, RedisValue min, RedisValue max, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetLengthByValue, key, min, max, exclude, flags);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="order"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue[] SortedSetRangeByRank(RedisKey key, long start = 0L, long stop = -1L, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetRangeByRank, key, start, stop, order, flags);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="order"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public SortedSetEntry[] SortedSetRangeByRankWithScores(RedisKey key, long start = 0L, long stop = -1L, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetRangeByRankWithScores, key, start, stop, order, flags);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="exclude"></param>
        /// <param name="order"></param>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue[] SortedSetRangeByScore(RedisKey key, double start = double.NegativeInfinity, double stop = double.PositiveInfinity, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0L, long take = -1L, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetRangeByScore, key, start, stop, exclude, order, skip, take, flags);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="exclude"></param>
        /// <param name="order"></param>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public SortedSetEntry[] SortedSetRangeByScoreWithScores(RedisKey key, double start = double.NegativeInfinity, double stop = double.PositiveInfinity, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0L, long take = -1L, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetRangeByScoreWithScores, key, start, stop, exclude, order, skip, take, flags);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="min"></param>
        /// <param name="max"></param>
        /// <param name="exclude"></param>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue[] SortedSetRangeByValue(RedisKey key, RedisValue min = default(RedisValue), RedisValue max = default(RedisValue), Exclude exclude = Exclude.None, long skip = 0L, long take = -1L, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetRangeByValue, key, min, max, exclude, skip, take, flags);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="order"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long? SortedSetRank(RedisKey key, RedisValue member, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetRank, key, member, order, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool SortedSetRemove(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetRemove, key, member, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="members"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SortedSetRemove(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetRemove, key, members, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SortedSetRemoveRangeByRank(RedisKey key, long start, long stop, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetRemoveRangeByRank, key, start, stop, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="exclude"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SortedSetRemoveRangeByScore(RedisKey key, double start, double stop, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetRemoveRangeByScore, key, start, stop, exclude, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="min"></param>
        /// <param name="max"></param>
        /// <param name="exclude"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long SortedSetRemoveRangeByValue(RedisKey key, RedisValue min, RedisValue max, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetRemoveRangeByValue, key, min, max, exclude, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="pattern"></param>
        /// <param name="pageSize"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public IEnumerable<SortedSetEntry> SortedSetScan(RedisKey key, RedisValue pattern, int pageSize, CommandFlags flags) {
            return FDBOpera(db.SortedSetScan, key, pattern, pageSize, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="pattern"></param>
        /// <param name="pageSize"></param>
        /// <param name="cursor"></param>
        /// <param name="pageOffset"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public IEnumerable<SortedSetEntry> SortedSetScan(RedisKey key, RedisValue pattern = default(RedisValue), int pageSize = 10, long cursor = 0L, int pageOffset = 0, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetScan, key, pattern, pageSize, cursor, pageOffset, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public double? SortedSetScore(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.SortedSetScore, key, member, flags);
        }

        /// <summary>
        /// 字符串追加
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long StringAppend(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringAppend, key, value, flags);
        }

        /// <summary>
        /// 某范围二进制中出现1的次数
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long StringBitCount(RedisKey key, long start = 0L, long end = -1L, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringBitCount, key, start, end, flags);
        }

        /// <summary>
        /// first 与 second做位运算，结果放在destination中
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="destination"></param>
        /// <param name="first"></param>
        /// <param name="second"></param>
        /// <param name="flags"></param>
        /// <returns>返回运算后的字符串长度</returns>
        public long StringBitOperation(Bitwise operation, RedisKey destination, RedisKey first, RedisKey second = default(RedisKey), CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringBitOperation, operation, destination, first, second, flags);
        }

        /// <summary>
        /// 一堆值做位运算。
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="destination"></param>
        /// <param name="keys"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long StringBitOperation(Bitwise operation, RedisKey destination, RedisKey[] keys, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringBitOperation, operation, destination, keys, flags);
        }

        /// <summary>
        /// 获取二进制中第一次出现1或0的位置
        /// </summary>
        /// <param name="key"></param>
        /// <param name="bit"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="flags"></param>
        /// <returns>返回其位置</returns>
        public long StringBitPosition(RedisKey key, bool bit, long start = 0L, long end = -1L, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringBitPosition, key, bit, start, end, flags);
        }

        /// <summary>
        /// 数值减去一个值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value">减去的值</param>
        /// <param name="flags"></param>
        /// <returns>返回减去后得到的结果</returns>
        public long StringDecrement(RedisKey key, long value = 1L, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringDecrement, key, value, flags);
        }

        /// <summary>
        /// 数值减去一个值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value">减去的值</param>
        /// <param name="flags"></param>
        /// <returns>返回减去后得到的结果</returns>
        public double StringDecrement(RedisKey key, double value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringDecrement, key, value, flags);
        }

        /// <summary>
        /// 获取String的值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue StringGet(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringGet, key, flags);
        }

        /// <summary>
        /// 获取一组String的值
        /// </summary>
        /// <param name="keys"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue[] StringGet(RedisKey[] keys, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringGet, keys, flags);
        }

        /// <summary>
        /// 获取某位二进制的值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="offset"></param>
        /// <param name="flags"></param>
        /// <returns>返回原来的值</returns>
        public bool StringGetBit(RedisKey key, long offset, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringGetBit, key, offset, flags);
        }

        /// <summary>
        /// 获取String的一个范围
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue StringGetRange(RedisKey key, long start, long end, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringGetRange, key, start, end, flags);
        }

        /// <summary>
        /// 获取原来的String 并用新值替换
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValue StringGetSet(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringGetSet, key, value, flags);
        }

        /// <summary>
        /// 获取String以及key的过期时间
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public RedisValueWithExpiry StringGetWithExpiry(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringGetWithExpiry, key, flags);
        }
        /// <summary>
        /// 数值增加一个值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long StringIncrement(RedisKey key, long value = 1L, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringIncrement, key, value, flags);
        }
        /// <summary>
        /// 数值增加一个值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public double StringIncrement(RedisKey key, double value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringIncrement, key, value, flags);
        }
        /// <summary>
        /// 获取字符串长
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public long StringLength(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringLength, key, flags);
        }

        /// <summary>
        /// 设置值字符串
        /// </summary>
        /// <param name="key">字符串的键</param>
        /// <param name="value">字符串的值</param>
        /// <param name="expiry">过期时间</param>
        /// <param name="when">那种情况设置值</param>
        /// <param name="flags">用于操作的标记</param>
        /// <returns>true 设置成功 false设置失败</returns>
        /// <remarks>https://redis.io/commands/set</remarks>
        public bool StringSet(RedisKey key, RedisValue value, TimeSpan? expiry = null, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringSet, key, value, expiry, when, flags);
        }

        /// <summary>
        /// 设置一组字符串值
        /// </summary>
        /// <param name="values">字符串键值对</param>
        /// <param name="when">设置的条件,要么都通过，要么都不通过</param>
        /// <param name="flags">操作的类型</param>
        /// <returns>true 表示成功 false表示失败</returns>
        public bool StringSet(KeyValuePair<RedisKey, RedisValue>[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringSet, values, when, flags);
        }

        /// <summary>
        /// 设置某位二进制的值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="offset"></param>
        /// <param name="bit"></param>
        /// <param name="flags"></param>
        /// <returns>返回二进制中原来的值</returns>
        public bool StringSetBit(RedisKey key, long offset, bool bit, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringSetBit, key, offset, bit, flags);
        }

        /// <summary>
        ///  从偏移量offset 开始 使用 value填充，如果原来没有值或者原来的长度小于 offset ，那从原来的字符串开始到offset使用'\0'字符填充。
        /// </summary>
        /// <param name="key"></param>
        /// <param name="offset"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns>修改后string的长度</returns>
        public RedisValue StringSetRange(RedisKey key, long offset, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.StringSetRange, key, offset, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue> DebugObjectAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.DebugObjectAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="longitude"></param>
        /// <param name="latitude"></param>
        /// <param name="member"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> GeoAddAsync(RedisKey key, double longitude, double latitude, RedisValue member, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.GeoAddAsync, key, longitude, latitude, member, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> GeoAddAsync(RedisKey key, GeoEntry value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.GeoAddAsync, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> GeoAddAsync(RedisKey key, GeoEntry[] values, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.GeoAddAsync, key, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> GeoRemoveAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.GeoRemoveAsync, key, member, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member1"></param>
        /// <param name="member2"></param>
        /// <param name="unit"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<double?> GeoDistanceAsync(RedisKey key, RedisValue member1, RedisValue member2, GeoUnit unit = GeoUnit.Meters, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.GeoDistanceAsync, key, member1, member2, unit, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="members"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<string[]> GeoHashAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.GeoHashAsync, key, members, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<string> GeoHashAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.GeoHashAsync, key, member, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="members"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<GeoPosition?[]> GeoPositionAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.GeoPositionAsync, key, members, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<GeoPosition?> GeoPositionAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.GeoPositionAsync, key, member, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="radius"></param>
        /// <param name="unit"></param>
        /// <param name="count"></param>
        /// <param name="order"></param>
        /// <param name="options"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<GeoRadiusResult[]> GeoRadiusAsync(RedisKey key, RedisValue member, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.GeoRadiusAsync, key, member, radius, unit, count, order, options, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="longitude"></param>
        /// <param name="latitude"></param>
        /// <param name="radius"></param>
        /// <param name="unit"></param>
        /// <param name="count"></param>
        /// <param name="order"></param>
        /// <param name="options"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<GeoRadiusResult[]> GeoRadiusAsync(RedisKey key, double longitude, double latitude, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.GeoRadiusAsync, key, longitude, latitude, radius, unit, count, order, options, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> HashDecrementAsync(RedisKey key, RedisValue hashField, long value = 1L, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HashDecrementAsync, key, hashField, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<double> HashDecrementAsync(RedisKey key, RedisValue hashField, double value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HashDecrementAsync, key, hashField, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> HashDeleteAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HashDeleteAsync, key, hashField, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashFields"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> HashDeleteAsync(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HashDeleteAsync, key, hashFields, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> HashExistsAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HashExistsAsync, key, hashField, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<HashEntry[]> HashGetAllAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HashGetAllAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue> HashGetAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HashGetAsync, key, hashField, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashFields"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue[]> HashGetAsync(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HashGetAsync, key, hashFields, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> HashIncrementAsync(RedisKey key, RedisValue hashField, long value = 1L, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HashIncrementAsync, key, hashField, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<double> HashIncrementAsync(RedisKey key, RedisValue hashField, double value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HashIncrementAsync, key, hashField, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue[]> HashKeysAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HashKeysAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> HashLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HashLengthAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashFields"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task HashSetAsync(RedisKey key, HashEntry[] hashFields, CommandFlags flags = CommandFlags.None) {
            return ADBOperaAsync(db.HashSetAsync, key, hashFields, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="hashField"></param>
        /// <param name="value"></param>
        /// <param name="when"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> HashSetAsync(RedisKey key, RedisValue hashField, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HashSetAsync, key, hashField, value, when, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue[]> HashValuesAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HashValuesAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> HyperLogLogAddAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HyperLogLogAddAsync, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> HyperLogLogAddAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HyperLogLogAddAsync, key, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> HyperLogLogLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HyperLogLogLengthAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="keys"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> HyperLogLogLengthAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.HyperLogLogLengthAsync, keys, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="destination"></param>
        /// <param name="first"></param>
        /// <param name="second"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task HyperLogLogMergeAsync(RedisKey destination, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) {
            return ADBOperaAsync(db.HyperLogLogMergeAsync, destination, first, second, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="destination"></param>
        /// <param name="sourceKeys"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task HyperLogLogMergeAsync(RedisKey destination, RedisKey[] sourceKeys, CommandFlags flags = CommandFlags.None) {
            return ADBOperaAsync(db.HyperLogLogMergeAsync, destination, sourceKeys, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<EndPoint> IdentifyEndpointAsync(RedisKey key = default(RedisKey), CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.IdentifyEndpointAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public bool IsConnected(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOpera(db.IsConnected, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> KeyDeleteAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.KeyDeleteAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="keys"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> KeyDeleteAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.KeyDeleteAsync, keys, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<byte[]> KeyDumpAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.KeyDumpAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> KeyExistsAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.KeyExistsAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="expiry"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> KeyExpireAsync(RedisKey key, TimeSpan? expiry, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.KeyExpireAsync, key, expiry, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="expiry"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> KeyExpireAsync(RedisKey key, DateTime? expiry, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.KeyExpireAsync, key, expiry, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="toServer"></param>
        /// <param name="toDatabase"></param>
        /// <param name="timeoutMilliseconds"></param>
        /// <param name="migrateOptions"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task KeyMigrateAsync(RedisKey key, EndPoint toServer, int toDatabase = 0, int timeoutMilliseconds = 0, MigrateOptions migrateOptions = MigrateOptions.None, CommandFlags flags = CommandFlags.None) {
            return ADBOperaAsync(db.KeyMigrateAsync, key, toServer, toDatabase, timeoutMilliseconds, migrateOptions, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="database"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> KeyMoveAsync(RedisKey key, int database, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.KeyMoveAsync, key, database, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> KeyPersistAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.KeyPersistAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisKey> KeyRandomAsync(CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.KeyRandomAsync, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="newKey"></param>
        /// <param name="when"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> KeyRenameAsync(RedisKey key, RedisKey newKey, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.KeyRenameAsync, key, newKey, when, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="expiry"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task KeyRestoreAsync(RedisKey key, byte[] value, TimeSpan? expiry = null, CommandFlags flags = CommandFlags.None) {
            return ADBOperaAsync(db.KeyRestoreAsync, key, value, expiry, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<TimeSpan?> KeyTimeToLiveAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.KeyTimeToLiveAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisType> KeyTypeAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.KeyTypeAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="index"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue> ListGetByIndexAsync(RedisKey key, long index, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ListGetByIndexAsync, key, index, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="pivot"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> ListInsertAfterAsync(RedisKey key, RedisValue pivot, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ListInsertAfterAsync, key, pivot, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="pivot"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> ListInsertBeforeAsync(RedisKey key, RedisValue pivot, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ListInsertBeforeAsync, key, pivot, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue> ListLeftPopAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ListLeftPopAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="when"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> ListLeftPushAsync(RedisKey key, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ListLeftPushAsync, key, value, when, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> ListLeftPushAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ListLeftPushAsync, key, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> ListLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ListLengthAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue[]> ListRangeAsync(RedisKey key, long start = 0L, long stop = -1L, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ListRangeAsync, key, start, stop, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="count"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> ListRemoveAsync(RedisKey key, RedisValue value, long count = 0L, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ListRemoveAsync, key, value, count, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue> ListRightPopAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ListRightPopAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="source"></param>
        /// <param name="destination"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue> ListRightPopLeftPushAsync(RedisKey source, RedisKey destination, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ListRightPopLeftPushAsync, source, destination, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="when"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> ListRightPushAsync(RedisKey key, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ListRightPushAsync, key, value, when, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> ListRightPushAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ListRightPushAsync, key, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="index"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task ListSetByIndexAsync(RedisKey key, long index, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return ADBOperaAsync(db.ListSetByIndexAsync, key, index, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task ListTrimAsync(RedisKey key, long start, long stop, CommandFlags flags = CommandFlags.None) {
            return ADBOperaAsync(db.ListTrimAsync, key, start, stop, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="expiry"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> LockExtendAsync(RedisKey key, RedisValue value, TimeSpan expiry, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.LockExtendAsync, key, value, expiry, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue> LockQueryAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.LockQueryAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> LockReleaseAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.LockReleaseAsync, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="expiry"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> LockTakeAsync(RedisKey key, RedisValue value, TimeSpan expiry, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.LockTakeAsync, key, value, expiry, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="channel"></param>
        /// <param name="message"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> PublishAsync(RedisChannel channel, RedisValue message, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.PublishAsync, channel, message, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="script"></param>
        /// <param name="keys"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisResult> ScriptEvaluateAsync(string script, RedisKey[] keys = null, RedisValue[] values = null, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ScriptEvaluateAsync, script, keys, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="hash"></param>
        /// <param name="keys"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisResult> ScriptEvaluateAsync(byte[] hash, RedisKey[] keys = null, RedisValue[] values = null, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ScriptEvaluateAsync, hash, keys, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="script"></param>
        /// <param name="parameters"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisResult> ScriptEvaluateAsync(LuaScript script, object parameters = null, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ScriptEvaluateAsync, script, parameters, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="script"></param>
        /// <param name="parameters"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisResult> ScriptEvaluateAsync(LoadedLuaScript script, object parameters = null, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.ScriptEvaluateAsync, script, parameters, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> SetAddAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetAddAsync, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SetAddAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetAddAsync, key, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="destination"></param>
        /// <param name="first"></param>
        /// <param name="second"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetCombineAndStoreAsync, operation, destination, first, second, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="destination"></param>
        /// <param name="keys"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey[] keys, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetCombineAndStoreAsync, operation, destination, keys, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="first"></param>
        /// <param name="second"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue[]> SetCombineAsync(SetOperation operation, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetCombineAsync, operation, first, second, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="keys"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue[]> SetCombineAsync(SetOperation operation, RedisKey[] keys, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetCombineAsync, operation, keys, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> SetContainsAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetContainsAsync, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SetLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetLengthAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue[]> SetMembersAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetMembersAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="source"></param>
        /// <param name="destination"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> SetMoveAsync(RedisKey source, RedisKey destination, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetMoveAsync, source, destination, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue> SetPopAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetPopAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue> SetRandomMemberAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetRandomMemberAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="count"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue[]> SetRandomMembersAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetRandomMembersAsync, key, count, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> SetRemoveAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetRemoveAsync, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SetRemoveAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SetRemoveAsync, key, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="destination"></param>
        /// <param name="key"></param>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="order"></param>
        /// <param name="sortType"></param>
        /// <param name="by"></param>
        /// <param name="get"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SortAndStoreAsync(RedisKey destination, RedisKey key, long skip = 0L, long take = -1L, Order order = Order.Ascending, SortType sortType = SortType.Numeric, RedisValue by = default(RedisValue), RedisValue[] get = null, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortAndStoreAsync, destination, key, skip, take, order, sortType, by, get, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="order"></param>
        /// <param name="sortType"></param>
        /// <param name="by"></param>
        /// <param name="get"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue[]> SortAsync(RedisKey key, long skip = 0L, long take = -1L, Order order = Order.Ascending, SortType sortType = SortType.Numeric, RedisValue by = default(RedisValue), RedisValue[] get = null, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortAsync, key, skip, take, order, sortType, by, get, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="score"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> SortedSetAddAsync(RedisKey key, RedisValue member, double score, CommandFlags flags) {
            return FDBOperaAsync(db.SortedSetAddAsync, key, member, score, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="score"></param>
        /// <param name="when"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> SortedSetAddAsync(RedisKey key, RedisValue member, double score, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetAddAsync, key, member, score, when, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SortedSetAddAsync(RedisKey key, SortedSetEntry[] values, CommandFlags flags) {
            return FDBOperaAsync(db.SortedSetAddAsync, key, values, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <param name="when"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SortedSetAddAsync(RedisKey key, SortedSetEntry[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetAddAsync, key, values, when, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="destination"></param>
        /// <param name="first"></param>
        /// <param name="second"></param>
        /// <param name="aggregate"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SortedSetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey first, RedisKey second, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetCombineAndStoreAsync, operation, destination, first, second, aggregate, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="destination"></param>
        /// <param name="keys"></param>
        /// <param name="weights"></param>
        /// <param name="aggregate"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SortedSetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey[] keys, double[] weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetCombineAndStoreAsync, operation, destination, keys, weights, aggregate, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<double> SortedSetDecrementAsync(RedisKey key, RedisValue member, double value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetDecrementAsync, key, member, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<double> SortedSetIncrementAsync(RedisKey key, RedisValue member, double value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetIncrementAsync, key, member, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="min"></param>
        /// <param name="max"></param>
        /// <param name="exclude"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SortedSetLengthAsync(RedisKey key, double min = double.NegativeInfinity, double max = double.PositiveInfinity, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetLengthAsync, key, min, max, exclude, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="min"></param>
        /// <param name="max"></param>
        /// <param name="exclude"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SortedSetLengthByValueAsync(RedisKey key, RedisValue min, RedisValue max, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetLengthByValueAsync, key, min, max, exclude, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="order"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue[]> SortedSetRangeByRankAsync(RedisKey key, long start = 0L, long stop = -1L, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetRangeByRankAsync, key, start, stop, order, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="order"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<SortedSetEntry[]> SortedSetRangeByRankWithScoresAsync(RedisKey key, long start = 0L, long stop = -1L, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetRangeByRankWithScoresAsync, key, start, stop, order, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="exclude"></param>
        /// <param name="order"></param>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue[]> SortedSetRangeByScoreAsync(RedisKey key, double start = double.NegativeInfinity, double stop = double.PositiveInfinity, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0L, long take = -1L, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetRangeByScoreAsync, key, start, stop, exclude, order, skip, take, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="exclude"></param>
        /// <param name="order"></param>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<SortedSetEntry[]> SortedSetRangeByScoreWithScoresAsync(RedisKey key, double start = double.NegativeInfinity, double stop = double.PositiveInfinity, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0L, long take = -1L, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetRangeByScoreWithScoresAsync, key, start, stop, exclude, order, skip, take, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="min"></param>
        /// <param name="max"></param>
        /// <param name="exclude"></param>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue[]> SortedSetRangeByValueAsync(RedisKey key, RedisValue min = default(RedisValue), RedisValue max = default(RedisValue), Exclude exclude = Exclude.None, long skip = 0L, long take = -1L, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetRangeByValueAsync, key, min, max, exclude, skip, take, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="order"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long?> SortedSetRankAsync(RedisKey key, RedisValue member, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetRankAsync, key, member, order, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> SortedSetRemoveAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetRemoveAsync, key, member, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="members"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SortedSetRemoveAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetRemoveAsync, key, members, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SortedSetRemoveRangeByRankAsync(RedisKey key, long start, long stop, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetRemoveRangeByRankAsync, key, start, stop, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="stop"></param>
        /// <param name="exclude"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SortedSetRemoveRangeByScoreAsync(RedisKey key, double start, double stop, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetRemoveRangeByScoreAsync, key, start, stop, exclude, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="min"></param>
        /// <param name="max"></param>
        /// <param name="exclude"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> SortedSetRemoveRangeByValueAsync(RedisKey key, RedisValue min, RedisValue max, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetRemoveRangeByValueAsync, key, min, max, exclude, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="member"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<double?> SortedSetScoreAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.SortedSetScoreAsync, key, member, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> StringAppendAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringAppendAsync, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> StringBitCountAsync(RedisKey key, long start = 0L, long end = -1L, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringBitCountAsync, key, start, end, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="destination"></param>
        /// <param name="first"></param>
        /// <param name="second"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> StringBitOperationAsync(Bitwise operation, RedisKey destination, RedisKey first, RedisKey second = default(RedisKey), CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringBitOperationAsync, operation, destination, first, second, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="destination"></param>
        /// <param name="keys"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> StringBitOperationAsync(Bitwise operation, RedisKey destination, RedisKey[] keys, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringBitOperationAsync, operation, destination, keys, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="bit"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> StringBitPositionAsync(RedisKey key, bool bit, long start = 0L, long end = -1L, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringBitPositionAsync, key, bit, start, end, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> StringDecrementAsync(RedisKey key, long value = 1L, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringDecrementAsync, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<double> StringDecrementAsync(RedisKey key, double value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringDecrementAsync, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue> StringGetAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringGetAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="keys"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue[]> StringGetAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringGetAsync, keys, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="offset"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> StringGetBitAsync(RedisKey key, long offset, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringGetBitAsync, key, offset, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue> StringGetRangeAsync(RedisKey key, long start, long end, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringGetRangeAsync, key, start, end, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue> StringGetSetAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringGetSetAsync, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValueWithExpiry> StringGetWithExpiryAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringGetWithExpiryAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> StringIncrementAsync(RedisKey key, long value = 1L, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringIncrementAsync, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<double> StringIncrementAsync(RedisKey key, double value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringIncrementAsync, key, value, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<long> StringLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringLengthAsync, key, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="expiry"></param>
        /// <param name="when"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> StringSetAsync(RedisKey key, RedisValue value, TimeSpan? expiry = null, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringSetAsync, key, value, expiry, when, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="values"></param>
        /// <param name="when"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> StringSetAsync(KeyValuePair<RedisKey, RedisValue>[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringSetAsync, values, when, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="offset"></param>
        /// <param name="bit"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<bool> StringSetBitAsync(RedisKey key, long offset, bool bit, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringSetBitAsync, key, offset, bit, flags);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="offset"></param>
        /// <param name="value"></param>
        /// <param name="flags"></param>
        /// <returns></returns>
        public Task<RedisValue> StringSetRangeAsync(RedisKey key, long offset, RedisValue value, CommandFlags flags = CommandFlags.None) {
            return FDBOperaAsync(db.StringSetRangeAsync, key, offset, value, flags);
        }
    }
}