@@ -112,6 +112,12 @@ internal static RedisResult TryCreate(PhysicalConnection connection, in RawResul
112112 /// <param name="result">The result to convert to a <see cref="long"/>.</param>
113113 public static explicit operator long ( RedisResult result ) => result . AsInt64 ( ) ;
114114 /// <summary>
115+ /// Interprets the result as an <see cref="ulong"/>.
116+ /// </summary>
117+ /// <param name="result">The result to convert to a <see cref="ulong"/>.</param>
118+ [ CLSCompliant ( false ) ]
119+ public static explicit operator ulong ( RedisResult result ) => result . AsUInt64 ( ) ;
120+ /// <summary>
115121 /// Interprets the result as an <see cref="int"/>.
116122 /// </summary>
117123 /// <param name="result">The result to convert to a <see cref="int"/>.</param>
@@ -142,6 +148,12 @@ internal static RedisResult TryCreate(PhysicalConnection connection, in RawResul
142148 /// <param name="result">The result to convert to a <see cref="T:Nullable{long}"/>.</param>
143149 public static explicit operator long ? ( RedisResult result ) => result . AsNullableInt64 ( ) ;
144150 /// <summary>
151+ /// Interprets the result as a <see cref="T:Nullable{ulong}"/>.
152+ /// </summary>
153+ /// <param name="result">The result to convert to a <see cref="T:Nullable{ulong}"/>.</param>
154+ [ CLSCompliant ( false ) ]
155+ public static explicit operator ulong ? ( RedisResult result ) => result . AsNullableUInt64 ( ) ;
156+ /// <summary>
145157 /// Interprets the result as a <see cref="T:Nullable{int}"/>.
146158 /// </summary>
147159 /// <param name="result">The result to convert to a <see cref="T:Nullable{int}"/>.</param>
@@ -172,6 +184,12 @@ internal static RedisResult TryCreate(PhysicalConnection connection, in RawResul
172184 /// <param name="result">The result to convert to a <see cref="T:long[]"/>.</param>
173185 public static explicit operator long [ ] ( RedisResult result ) => result . AsInt64Array ( ) ;
174186 /// <summary>
187+ /// Interprets the result as a <see cref="T:ulong[]"/>.
188+ /// </summary>
189+ /// <param name="result">The result to convert to a <see cref="T:ulong[]"/>.</param>
190+ [ CLSCompliant ( false ) ]
191+ public static explicit operator ulong [ ] ( RedisResult result ) => result . AsUInt64Array ( ) ;
192+ /// <summary>
175193 /// Interprets the result as a <see cref="T:int[]"/>.
176194 /// </summary>
177195 /// <param name="result">The result to convert to a <see cref="T:int[]"/>.</param>
@@ -206,11 +224,14 @@ internal static RedisResult TryCreate(PhysicalConnection connection, in RawResul
206224 internal abstract int AsInt32 ( ) ;
207225 internal abstract int [ ] AsInt32Array ( ) ;
208226 internal abstract long AsInt64 ( ) ;
227+ internal abstract ulong AsUInt64 ( ) ;
209228 internal abstract long [ ] AsInt64Array ( ) ;
229+ internal abstract ulong [ ] AsUInt64Array ( ) ;
210230 internal abstract bool ? AsNullableBoolean ( ) ;
211231 internal abstract double ? AsNullableDouble ( ) ;
212232 internal abstract int ? AsNullableInt32 ( ) ;
213233 internal abstract long ? AsNullableInt64 ( ) ;
234+ internal abstract ulong ? AsNullableUInt64 ( ) ;
214235 internal abstract RedisKey AsRedisKey ( ) ;
215236 internal abstract RedisKey [ ] AsRedisKeyArray ( ) ;
216237 internal abstract RedisResult [ ] AsRedisResultArray ( ) ;
@@ -279,12 +300,22 @@ internal override long AsInt64()
279300 if ( IsSingleton ) return _value [ 0 ] . AsInt64 ( ) ;
280301 throw new InvalidCastException ( ) ;
281302 }
303+ internal override ulong AsUInt64 ( )
304+ {
305+ if ( IsSingleton ) return _value [ 0 ] . AsUInt64 ( ) ;
306+ throw new InvalidCastException ( ) ;
307+ }
282308
283309 internal override long [ ] AsInt64Array ( )
284310 => IsNull ? null
285311 : IsEmpty ? Array . Empty < long > ( )
286312 : Array . ConvertAll ( _value , x => x . AsInt64 ( ) ) ;
287313
314+ internal override ulong [ ] AsUInt64Array ( )
315+ => IsNull ? null
316+ : IsEmpty ? Array . Empty < ulong > ( )
317+ : Array . ConvertAll ( _value , x => x . AsUInt64 ( ) ) ;
318+
288319 internal override bool ? AsNullableBoolean ( )
289320 {
290321 if ( IsSingleton ) return _value [ 0 ] . AsNullableBoolean ( ) ;
@@ -308,6 +339,11 @@ internal override long[] AsInt64Array()
308339 if ( IsSingleton ) return _value [ 0 ] . AsNullableInt64 ( ) ;
309340 throw new InvalidCastException ( ) ;
310341 }
342+ internal override ulong ? AsNullableUInt64 ( )
343+ {
344+ if ( IsSingleton ) return _value [ 0 ] . AsNullableUInt64 ( ) ;
345+ throw new InvalidCastException ( ) ;
346+ }
311347
312348 internal override RedisKey AsRedisKey ( )
313349 {
@@ -378,11 +414,14 @@ public ErrorRedisResult(string value)
378414 internal override int AsInt32 ( ) => throw new RedisServerException ( value ) ;
379415 internal override int [ ] AsInt32Array ( ) => throw new RedisServerException ( value ) ;
380416 internal override long AsInt64 ( ) => throw new RedisServerException ( value ) ;
417+ internal override ulong AsUInt64 ( ) => throw new RedisServerException ( value ) ;
381418 internal override long [ ] AsInt64Array ( ) => throw new RedisServerException ( value ) ;
419+ internal override ulong [ ] AsUInt64Array ( ) => throw new RedisServerException ( value ) ;
382420 internal override bool ? AsNullableBoolean ( ) => throw new RedisServerException ( value ) ;
383421 internal override double ? AsNullableDouble ( ) => throw new RedisServerException ( value ) ;
384422 internal override int ? AsNullableInt32 ( ) => throw new RedisServerException ( value ) ;
385423 internal override long ? AsNullableInt64 ( ) => throw new RedisServerException ( value ) ;
424+ internal override ulong ? AsNullableUInt64 ( ) => throw new RedisServerException ( value ) ;
386425 internal override RedisKey AsRedisKey ( ) => throw new RedisServerException ( value ) ;
387426 internal override RedisKey [ ] AsRedisKeyArray ( ) => throw new RedisServerException ( value ) ;
388427 internal override RedisResult [ ] AsRedisResultArray ( ) => throw new RedisServerException ( value ) ;
@@ -415,11 +454,14 @@ public SingleRedisResult(RedisValue value, ResultType? resultType)
415454 internal override int AsInt32 ( ) => ( int ) _value ;
416455 internal override int [ ] AsInt32Array ( ) => new [ ] { AsInt32 ( ) } ;
417456 internal override long AsInt64 ( ) => ( long ) _value ;
457+ internal override ulong AsUInt64 ( ) => ( ulong ) _value ;
418458 internal override long [ ] AsInt64Array ( ) => new [ ] { AsInt64 ( ) } ;
459+ internal override ulong [ ] AsUInt64Array ( ) => new [ ] { AsUInt64 ( ) } ;
419460 internal override bool ? AsNullableBoolean ( ) => ( bool ? ) _value ;
420461 internal override double ? AsNullableDouble ( ) => ( double ? ) _value ;
421462 internal override int ? AsNullableInt32 ( ) => ( int ? ) _value ;
422463 internal override long ? AsNullableInt64 ( ) => ( long ? ) _value ;
464+ internal override ulong ? AsNullableUInt64 ( ) => ( ulong ? ) _value ;
423465 internal override RedisKey AsRedisKey ( ) => ( byte [ ] ) _value ;
424466 internal override RedisKey [ ] AsRedisKeyArray ( ) => new [ ] { AsRedisKey ( ) } ;
425467 internal override RedisResult [ ] AsRedisResultArray ( ) => throw new InvalidCastException ( ) ;
0 commit comments