16
16
using System . Collections . Generic ;
17
17
using System . Linq ;
18
18
using System . Text ;
19
- using System . Threading ;
20
19
using ServiceStack . Redis . Generic ;
21
20
using ServiceStack . Redis . Pipeline ;
22
21
using ServiceStack . Text ;
@@ -108,42 +107,36 @@ public RedisText Custom(params object[] cmdWithArgs)
108
107
return ret ;
109
108
}
110
109
111
- public DateTime ConvertToServerDate ( DateTime expiresAt )
112
- {
113
- //placeholder if we ever try to compensate for differences in server-time
114
- return expiresAt ;
115
- }
110
+ public DateTime ConvertToServerDate ( DateTime expiresAt ) => expiresAt ;
116
111
117
- public string GetTypeSequenceKey < T > ( )
118
- {
119
- return String . Concat ( NamespacePrefix , "seq:" , typeof ( T ) . Name ) ;
120
- }
112
+ public string GetTypeSequenceKey < T > ( ) => string . Concat ( NamespacePrefix , "seq:" , typeof ( T ) . Name ) ;
121
113
122
- public string GetTypeIdsSetKey < T > ( )
123
- {
124
- return String . Concat ( NamespacePrefix , "ids:" , typeof ( T ) . Name ) ;
125
- }
114
+ public string GetTypeIdsSetKey < T > ( ) => string . Concat ( NamespacePrefix , "ids:" , typeof ( T ) . Name ) ;
126
115
127
- public string GetTypeIdsSetKey ( Type type )
128
- {
129
- return String . Concat ( NamespacePrefix , "ids:" , type . Name ) ;
130
- }
116
+ public string GetTypeIdsSetKey ( Type type ) => string . Concat ( NamespacePrefix , "ids:" , type . Name ) ;
131
117
132
- public void RewriteAppendOnlyFileAsync ( )
133
- {
134
- base . BgRewriteAof ( ) ;
135
- }
118
+ public void RewriteAppendOnlyFileAsync ( ) => base . BgRewriteAof ( ) ;
136
119
137
- public List < string > GetAllKeys ( )
138
- {
139
- return SearchKeys ( "*" ) ;
140
- }
120
+ public List < string > GetAllKeys ( ) => SearchKeys ( "*" ) ;
141
121
142
122
[ Obsolete ( "Use SetValue()" ) ]
143
- public void SetEntry ( string key , string value )
144
- {
145
- SetValue ( key , value ) ;
146
- }
123
+ public void SetEntry ( string key , string value ) => SetValue ( key , value ) ;
124
+ [ Obsolete ( "Use SetValue()" ) ]
125
+ public void SetEntry ( string key , string value , TimeSpan expireIn ) => SetValue ( key , value , expireIn ) ;
126
+ [ Obsolete ( "Use SetValueIfExists()" ) ]
127
+ public bool SetEntryIfExists ( string key , string value ) => SetValueIfExists ( key , value ) ;
128
+ [ Obsolete ( "Use SetValueIfNotExists()" ) ]
129
+ public bool SetEntryIfNotExists ( string key , string value ) => SetValueIfNotExists ( key , value ) ;
130
+ [ Obsolete ( "Use SetValueIfExists()" ) ]
131
+ public bool SetEntryIfExists ( string key , string value , TimeSpan expireIn ) => SetValueIfExists ( key , value , expireIn ) ;
132
+ [ Obsolete ( "Use SetValueIfNotExists()" ) ]
133
+ public bool SetEntryIfNotExists ( string key , string value , TimeSpan expireIn ) => SetValueIfNotExists ( key , value , expireIn ) ;
134
+ [ Obsolete ( "Use GetClientsInfo" ) ]
135
+ public List < Dictionary < string , string > > GetClientList ( ) => GetClientsInfo ( ) ;
136
+ [ Obsolete ( "Use GetValue()" ) ]
137
+ public string GetEntry ( string key ) => GetValue ( key ) ;
138
+ [ Obsolete ( "Use GetAndSetValue()" ) ]
139
+ public string GetAndSetEntry ( string key , string value ) => GetAndSetValue ( key , value ) ;
147
140
148
141
public void SetValue ( string key , string value )
149
142
{
@@ -168,12 +161,6 @@ public bool SetValue(byte[] key, byte[] value, TimeSpan expireIn)
168
161
return true ;
169
162
}
170
163
171
- [ Obsolete ( "Use SetValue()" ) ]
172
- public void SetEntry ( string key , string value , TimeSpan expireIn )
173
- {
174
- SetValue ( key , value , expireIn ) ;
175
- }
176
-
177
164
public void SetValue ( string key , string value , TimeSpan expireIn )
178
165
{
179
166
var bytesValue = value != null
@@ -193,38 +180,20 @@ public void SetValue(string key, string value, TimeSpan expireIn)
193
180
}
194
181
}
195
182
196
- [ Obsolete ( "Use SetValueIfExists()" ) ]
197
- public bool SetEntryIfExists ( string key , string value )
198
- {
199
- return SetValueIfExists ( key , value ) ;
200
- }
201
-
202
183
public bool SetValueIfExists ( string key , string value )
203
184
{
204
185
var bytesValue = value != null ? value . ToUtf8Bytes ( ) : null ;
205
186
206
187
return base . Set ( key , bytesValue , exists : true ) ;
207
188
}
208
189
209
- [ Obsolete ( "Use SetValueIfNotExists()" ) ]
210
- public bool SetEntryIfNotExists ( string key , string value )
211
- {
212
- return SetValueIfNotExists ( key , value ) ;
213
- }
214
-
215
190
public bool SetValueIfNotExists ( string key , string value )
216
191
{
217
192
var bytesValue = value != null ? value . ToUtf8Bytes ( ) : null ;
218
193
219
194
return base . Set ( key , bytesValue , exists : false ) ;
220
195
}
221
196
222
- [ Obsolete ( "Use SetValueIfExists()" ) ]
223
- public bool SetEntryIfExists ( string key , string value , TimeSpan expireIn )
224
- {
225
- return SetValueIfExists ( key , value , expireIn ) ;
226
- }
227
-
228
197
public bool SetValueIfExists ( string key , string value , TimeSpan expireIn )
229
198
{
230
199
var bytesValue = value != null ? value . ToUtf8Bytes ( ) : null ;
@@ -235,12 +204,6 @@ public bool SetValueIfExists(string key, string value, TimeSpan expireIn)
235
204
return base . Set ( key , bytesValue , exists : true , expirySeconds : ( int ) expireIn . TotalSeconds ) ;
236
205
}
237
206
238
- [ Obsolete ( "Use SetValueIfNotExists()" ) ]
239
- public bool SetEntryIfNotExists ( string key , string value , TimeSpan expireIn )
240
- {
241
- return SetValueIfNotExists ( key , value , expireIn ) ;
242
- }
243
-
244
207
public bool SetValueIfNotExists ( string key , string value , TimeSpan expireIn )
245
208
{
246
209
var bytesValue = value != null ? value . ToUtf8Bytes ( ) : null ;
@@ -251,12 +214,6 @@ public bool SetValueIfNotExists(string key, string value, TimeSpan expireIn)
251
214
return base . Set ( key , bytesValue , exists : false , expirySeconds : ( int ) expireIn . TotalSeconds ) ;
252
215
}
253
216
254
- [ Obsolete ( "Use GetClientsInfo" ) ]
255
- public List < Dictionary < string , string > > GetClientList ( )
256
- {
257
- return GetClientsInfo ( ) ;
258
- }
259
-
260
217
public void SetValues ( Dictionary < string , string > map )
261
218
{
262
219
SetAll ( map ) ;
@@ -303,12 +260,6 @@ public void SetAll(Dictionary<string, string> map)
303
260
base . MSet ( keyBytes , valBytes ) ;
304
261
}
305
262
306
- [ Obsolete ( "Use GetValue()" ) ]
307
- public string GetEntry ( string key )
308
- {
309
- return GetValue ( key ) ;
310
- }
311
-
312
263
public string GetValue ( string key )
313
264
{
314
265
var bytes = Get ( key ) ;
@@ -317,12 +268,6 @@ public string GetValue(string key)
317
268
: bytes . FromUtf8Bytes ( ) ;
318
269
}
319
270
320
- [ Obsolete ( "Use GetAndSetValue()" ) ]
321
- public string GetAndSetEntry ( string key , string value )
322
- {
323
- return GetAndSetValue ( key , value ) ;
324
- }
325
-
326
271
public string GetAndSetValue ( string key , string value )
327
272
{
328
273
return GetSet ( key , value . ToUtf8Bytes ( ) ) . FromUtf8Bytes ( ) ;
0 commit comments