1616using System . Collections . Generic ;
1717using System . Linq ;
1818using System . Text ;
19- using System . Threading ;
2019using ServiceStack . Redis . Generic ;
2120using ServiceStack . Redis . Pipeline ;
2221using ServiceStack . Text ;
@@ -108,42 +107,36 @@ public RedisText Custom(params object[] cmdWithArgs)
108107 return ret ;
109108 }
110109
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 ;
116111
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 ) ;
121113
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 ) ;
126115
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 ) ;
131117
132- public void RewriteAppendOnlyFileAsync ( )
133- {
134- base . BgRewriteAof ( ) ;
135- }
118+ public void RewriteAppendOnlyFileAsync ( ) => base . BgRewriteAof ( ) ;
136119
137- public List < string > GetAllKeys ( )
138- {
139- return SearchKeys ( "*" ) ;
140- }
120+ public List < string > GetAllKeys ( ) => SearchKeys ( "*" ) ;
141121
142122 [ 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 ) ;
147140
148141 public void SetValue ( string key , string value )
149142 {
@@ -168,12 +161,6 @@ public bool SetValue(byte[] key, byte[] value, TimeSpan expireIn)
168161 return true ;
169162 }
170163
171- [ Obsolete ( "Use SetValue()" ) ]
172- public void SetEntry ( string key , string value , TimeSpan expireIn )
173- {
174- SetValue ( key , value , expireIn ) ;
175- }
176-
177164 public void SetValue ( string key , string value , TimeSpan expireIn )
178165 {
179166 var bytesValue = value != null
@@ -193,38 +180,20 @@ public void SetValue(string key, string value, TimeSpan expireIn)
193180 }
194181 }
195182
196- [ Obsolete ( "Use SetValueIfExists()" ) ]
197- public bool SetEntryIfExists ( string key , string value )
198- {
199- return SetValueIfExists ( key , value ) ;
200- }
201-
202183 public bool SetValueIfExists ( string key , string value )
203184 {
204185 var bytesValue = value != null ? value . ToUtf8Bytes ( ) : null ;
205186
206187 return base . Set ( key , bytesValue , exists : true ) ;
207188 }
208189
209- [ Obsolete ( "Use SetValueIfNotExists()" ) ]
210- public bool SetEntryIfNotExists ( string key , string value )
211- {
212- return SetValueIfNotExists ( key , value ) ;
213- }
214-
215190 public bool SetValueIfNotExists ( string key , string value )
216191 {
217192 var bytesValue = value != null ? value . ToUtf8Bytes ( ) : null ;
218193
219194 return base . Set ( key , bytesValue , exists : false ) ;
220195 }
221196
222- [ Obsolete ( "Use SetValueIfExists()" ) ]
223- public bool SetEntryIfExists ( string key , string value , TimeSpan expireIn )
224- {
225- return SetValueIfExists ( key , value , expireIn ) ;
226- }
227-
228197 public bool SetValueIfExists ( string key , string value , TimeSpan expireIn )
229198 {
230199 var bytesValue = value != null ? value . ToUtf8Bytes ( ) : null ;
@@ -235,12 +204,6 @@ public bool SetValueIfExists(string key, string value, TimeSpan expireIn)
235204 return base . Set ( key , bytesValue , exists : true , expirySeconds : ( int ) expireIn . TotalSeconds ) ;
236205 }
237206
238- [ Obsolete ( "Use SetValueIfNotExists()" ) ]
239- public bool SetEntryIfNotExists ( string key , string value , TimeSpan expireIn )
240- {
241- return SetValueIfNotExists ( key , value , expireIn ) ;
242- }
243-
244207 public bool SetValueIfNotExists ( string key , string value , TimeSpan expireIn )
245208 {
246209 var bytesValue = value != null ? value . ToUtf8Bytes ( ) : null ;
@@ -251,12 +214,6 @@ public bool SetValueIfNotExists(string key, string value, TimeSpan expireIn)
251214 return base . Set ( key , bytesValue , exists : false , expirySeconds : ( int ) expireIn . TotalSeconds ) ;
252215 }
253216
254- [ Obsolete ( "Use GetClientsInfo" ) ]
255- public List < Dictionary < string , string > > GetClientList ( )
256- {
257- return GetClientsInfo ( ) ;
258- }
259-
260217 public void SetValues ( Dictionary < string , string > map )
261218 {
262219 SetAll ( map ) ;
@@ -303,12 +260,6 @@ public void SetAll(Dictionary<string, string> map)
303260 base . MSet ( keyBytes , valBytes ) ;
304261 }
305262
306- [ Obsolete ( "Use GetValue()" ) ]
307- public string GetEntry ( string key )
308- {
309- return GetValue ( key ) ;
310- }
311-
312263 public string GetValue ( string key )
313264 {
314265 var bytes = Get ( key ) ;
@@ -317,12 +268,6 @@ public string GetValue(string key)
317268 : bytes . FromUtf8Bytes ( ) ;
318269 }
319270
320- [ Obsolete ( "Use GetAndSetValue()" ) ]
321- public string GetAndSetEntry ( string key , string value )
322- {
323- return GetAndSetValue ( key , value ) ;
324- }
325-
326271 public string GetAndSetValue ( string key , string value )
327272 {
328273 return GetSet ( key , value . ToUtf8Bytes ( ) ) . FromUtf8Bytes ( ) ;
0 commit comments