@@ -130,7 +130,8 @@ public void SetEntry(string key, string value, TimeSpan expireIn)
130
130
{
131
131
base . Set ( key , bytesValue , ( int ) expireIn . TotalSeconds ) ;
132
132
}
133
- else {
133
+ else
134
+ {
134
135
base . Set ( key , bytesValue , null , ( long ) expireIn . TotalMilliseconds ) ;
135
136
}
136
137
}
@@ -149,6 +150,14 @@ public void SetEntryIfExists(string key, string value, TimeSpan expireIn)
149
150
}
150
151
}
151
152
153
+ public bool SetEntryIfNotExists ( string key , string value )
154
+ {
155
+ if ( value == null )
156
+ throw new ArgumentNullException ( "value" ) ;
157
+
158
+ return SetNX ( key , value . ToUtf8Bytes ( ) ) == Success ;
159
+ }
160
+
152
161
public void SetEntryIfNotExists ( string key , string value , TimeSpan expireIn )
153
162
{
154
163
var bytesValue = value != null ? value . ToUtf8Bytes ( ) : null ;
@@ -232,23 +241,6 @@ public void SetAll(Dictionary<string, string> map)
232
241
base . MSet ( keyBytes , valBytes ) ;
233
242
}
234
243
235
- public void SetEntry ( string key , string value , TimeSpan expireIn )
236
- {
237
- var bytesValue = value != null
238
- ? value . ToUtf8Bytes ( )
239
- : null ;
240
-
241
- SetEx ( key , ( int ) expireIn . TotalSeconds , bytesValue ) ;
242
- }
243
-
244
- public bool SetEntryIfNotExists ( string key , string value )
245
- {
246
- if ( value == null )
247
- throw new ArgumentNullException ( "value" ) ;
248
-
249
- return SetNX ( key , value . ToUtf8Bytes ( ) ) == Success ;
250
- }
251
-
252
244
public string GetValue ( string key )
253
245
{
254
246
var bytes = Get ( key ) ;
0 commit comments