コード例 #1
0
        public static IServer GetServerOrDefault(this ConnectionMultiplexer redis, string hostAndPort)
        {
            if (string.IsNullOrWhiteSpace(hostAndPort))
            {
                return(redis.GetFirstServer());
            }

            try
            {
                return(redis.GetServer(hostAndPort));
            }
            catch (Exception)
            {
                return(null);
            }
        }