@@ -7,11 +7,11 @@ namespace NRedisStack;
77/// Represents a Redis client that can connect to a Redis server
88/// providing access to <see cref="IRedisDatabase"/> instances as well as the underlying multiplexer.
99/// </summary>
10- public class RedisClient
10+ public class RedisClient : IRedisClient
1111{
12- private ConnectionMultiplexer _multiplexer ;
12+ private IConnectionMultiplexer _multiplexer ;
1313
14- private RedisClient ( ConnectionMultiplexer multiplexer )
14+ private RedisClient ( IConnectionMultiplexer multiplexer )
1515 {
1616 _multiplexer = multiplexer ;
1717 }
@@ -21,7 +21,7 @@ private RedisClient(ConnectionMultiplexer multiplexer)
2121 /// </summary>
2222 /// <param name="configuration">The string configuration to use for this client.</param>
2323 /// <param name="log">The <see cref="TextWriter"/> to log to.</param>
24- public static async Task < RedisClient > ConnectAsync ( string configuration , TextWriter ? log = null ) =>
24+ public static async Task < IRedisClient > ConnectAsync ( string configuration , TextWriter ? log = null ) =>
2525 await ConnectAsync ( ConfigurationOptions . Parse ( configuration ) , log ) ;
2626
2727 /// <summary>
@@ -30,7 +30,7 @@ public static async Task<RedisClient> ConnectAsync(string configuration, TextWri
3030 /// <param name="configuration">The string configuration to use for this client.</param>
3131 /// <param name="configure">Action to further modify the parsed configuration options.</param>
3232 /// <param name="log">The <see cref="TextWriter"/> to log to.</param>
33- public static async Task < RedisClient > ConnectAsync ( string configuration , Action < ConfigurationOptions > configure , TextWriter ? log = null )
33+ public static async Task < IRedisClient > ConnectAsync ( string configuration , Action < ConfigurationOptions > configure , TextWriter ? log = null )
3434 {
3535 Action < ConfigurationOptions > config = ( ConfigurationOptions config ) =>
3636 {
@@ -46,7 +46,7 @@ public static async Task<RedisClient> ConnectAsync(string configuration, Action<
4646 /// <param name="configuration">The configuration options to use for this client.</param>
4747 /// <param name="log">The <see cref="TextWriter"/> to log to.</param>
4848 /// <remarks>Note: For Sentinel, do <b>not</b> specify a <see cref="ConfigurationOptions.CommandMap"/> - this is handled automatically.</remarks>
49- public static async Task < RedisClient > ConnectAsync ( ConfigurationOptions configuration , TextWriter ? log = null )
49+ public static async Task < IRedisClient > ConnectAsync ( ConfigurationOptions configuration , TextWriter ? log = null )
5050 {
5151 SetNames ( configuration ) ;
5252 return new RedisClient ( await ConnectionMultiplexer . ConnectAsync ( configuration , log ) ) ;
@@ -55,9 +55,9 @@ public static async Task<RedisClient> ConnectAsync(ConfigurationOptions configur
5555 /// <summary>
5656 /// Creates a new <see cref="RedisClient"/> instance.
5757 /// </summary>
58- /// <param name="configuration">The string configuration to use for this client.</param>
58+ /// <param name="configuration">The string configuration to use for this client. See the StackExchange.Redis configuration documentation(https://stackexchange.github.io/StackExchange.Redis/Configuration) for detailed information. </param>
5959 /// <param name="log">The <see cref="TextWriter"/> to log to.</param>
60- public static RedisClient Connect ( string configuration , TextWriter ? log = null ) =>
60+ public static IRedisClient Connect ( string configuration , TextWriter ? log = null ) =>
6161 Connect ( ConfigurationOptions . Parse ( configuration ) , log ) ;
6262
6363 /// <summary>
@@ -66,7 +66,7 @@ public static RedisClient Connect(string configuration, TextWriter? log = null)
6666 /// <param name="configuration">The string configuration to use for this client.</param>
6767 /// <param name="configure">Action to further modify the parsed configuration options.</param>
6868 /// <param name="log">The <see cref="TextWriter"/> to log to.</param>
69- public static RedisClient Connect ( string configuration , Action < ConfigurationOptions > configure , TextWriter ? log = null )
69+ public static IRedisClient Connect ( string configuration , Action < ConfigurationOptions > configure , TextWriter ? log = null )
7070 {
7171 Action < ConfigurationOptions > config = ( ConfigurationOptions config ) =>
7272 {
@@ -82,7 +82,7 @@ public static RedisClient Connect(string configuration, Action<ConfigurationOpti
8282 /// <param name="configuration">The configuration options to use for this client.</param>
8383 /// <param name="log">The <see cref="TextWriter"/> to log to.</param>
8484 /// <remarks>Note: For Sentinel, do <b>not</b> specify a <see cref="ConfigurationOptions.CommandMap"/> - this is handled automatically.</remarks>
85- public static RedisClient Connect ( ConfigurationOptions configuration , TextWriter ? log = null )
85+ public static IRedisClient Connect ( ConfigurationOptions configuration , TextWriter ? log = null )
8686 {
8787 SetNames ( configuration ) ;
8888 return new RedisClient ( ConnectionMultiplexer . Connect ( configuration , log ) ) ;
@@ -104,7 +104,7 @@ public IRedisDatabase GetDatabase(int db = -1, object? asyncState = null)
104104 /// Gets the underlying <see cref="ConnectionMultiplexer"/> instance.
105105 /// </summary>
106106 /// <returns></returns>
107- public ConnectionMultiplexer GetMultiplexer ( )
107+ public IConnectionMultiplexer GetMultiplexer ( )
108108 {
109109 return _multiplexer ;
110110 }
0 commit comments