csredis
                                
                                
                                
                                    csredis copied to clipboard
                            
                            
                            
                        Bug in BuildConnectionString Method
The BuildConnectionString method in the RedisClientPool class has a bug when constructing the connection string. In line 117, a comma is missing before the user parameter, causing a runtime error. I fixed this issue locally by adding the necessary comma, resolving the bug.
ORIGINAL CODE
internal string BuildConnectionString(string endpoint) { return $"{endpoint}{(string.IsNullOrEmpty(_user) ? "" : $"user={_user}")},password={_password},defaultDatabase={_database},poolsize={PoolSize}," + $"connectTimeout={_connectTimeout},syncTimeout={_syncTimeout},idletimeout={(int)IdleTimeout.TotalMilliseconds}," + $"preheat=false,ssl={(_ssl ? "true" : "false")},tryit={_tryit},name={_clientname},prefix={Prefix}," + $"autodispose={(IsAutoDisposeWithSystem ? "true" : "false")},asyncpipeline={(_asyncPipeline ? "true" : "false")}"; }
FIXED CODE
internal string BuildConnectionString(string endpoint) { return $"{endpoint}{(string.IsNullOrEmpty(_user) ? "" : $",user={_user}")},password={_password},defaultDatabase={_database},poolsize={PoolSize}," + $"connectTimeout={_connectTimeout},syncTimeout={_syncTimeout},idletimeout={(int)IdleTimeout.TotalMilliseconds}," + $"preheat=false,ssl={(_ssl ? "true" : "false")},tryit={_tryit},name={_clientname},prefix={Prefix}," + $"autodispose={(IsAutoDisposeWithSystem ? "true" : "false")},asyncpipeline={(_asyncPipeline ? "true" : "false")}"; }