@@ -36,15 +36,9 @@ static RedisTypedClient()
3636 readonly ITypeSerializer < T > serializer = new JsonSerializer < T > ( ) ;
3737 private readonly RedisClient client ;
3838
39- public IRedisClient RedisClient
40- {
41- get { return client ; }
42- }
39+ public IRedisClient RedisClient => client ;
4340
44- public IRedisNativeClient NativeClient
45- {
46- get { return client ; }
47- }
41+ public IRedisNativeClient NativeClient => client ;
4842
4943 /// <summary>
5044 /// Use this to share the same redis connection with another
@@ -88,26 +82,14 @@ public IDisposable AcquireLock(TimeSpan timeOut)
8882
8983 public IRedisTransactionBase Transaction
9084 {
91- get
92- {
93- return client . Transaction ;
94- }
95- set
96- {
97- client . Transaction = value ;
98- }
85+ get => client . Transaction ;
86+ set => client . Transaction = value ;
9987 }
10088
10189 public IRedisPipelineShared Pipeline
10290 {
103- get
104- {
105- return client . Pipeline ;
106- }
107- set
108- {
109- client . Pipeline = value ;
110- }
91+ get => client . Pipeline ;
92+ set => client . Pipeline = value ;
11193 }
11294
11395 public void Watch ( params string [ ] keys )
@@ -155,18 +137,12 @@ public string UrnKey(T entity)
155137 return client . UrnKey ( entity ) ;
156138 }
157139
158- public IRedisSet TypeIdsSet
159- {
160- get
161- {
162- return new RedisClientSet ( client , client . GetTypeIdsSetKey < T > ( ) ) ;
163- }
164- }
140+ public IRedisSet TypeIdsSet => new RedisClientSet ( client , client . GetTypeIdsSetKey < T > ( ) ) ;
165141
166142 public T this [ string key ]
167143 {
168- get { return GetValue ( key ) ; }
169- set { SetValue ( key , value ) ; }
144+ get => GetValue ( key ) ;
145+ set => SetValue ( key , value ) ;
170146 }
171147
172148 public byte [ ] SerializeValue ( T value )
@@ -184,7 +160,7 @@ public T DeserializeValue(byte[] value)
184160 public void SetValue ( string key , T entity )
185161 {
186162 if ( key == null )
187- throw new ArgumentNullException ( " key" ) ;
163+ throw new ArgumentNullException ( nameof ( key ) ) ;
188164
189165 client . Set ( key , SerializeValue ( entity ) ) ;
190166 client . RegisterTypeId ( entity ) ;
@@ -193,7 +169,7 @@ public void SetValue(string key, T entity)
193169 public void SetValue ( string key , T entity , TimeSpan expireIn )
194170 {
195171 if ( key == null )
196- throw new ArgumentNullException ( " key" ) ;
172+ throw new ArgumentNullException ( nameof ( key ) ) ;
197173
198174 client . Set ( key , SerializeValue ( entity ) , expireIn ) ;
199175 client . RegisterTypeId ( entity ) ;
0 commit comments