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); } }