@@ -141,6 +141,10 @@ public abstract class NumericCompatibleDataType : DataType
141141 public abstract object ? Divide ( object ? a , object ? b ) ;
142142
143143 public DataValue Divide ( DataValue a , DataValue b ) => new ( Divide ( a . Value , b . Value ) , this ) ;
144+
145+ public abstract object ? Modulus ( object ? a , object ? b ) ;
146+
147+ public DataValue Modulus ( DataValue a , DataValue b ) => new ( Modulus ( a . Value , b . Value ) , this ) ;
144148 }
145149
146150 public abstract class BitwiseCompatibleDataType : NumericCompatibleDataType
@@ -178,6 +182,8 @@ private sealed class DbBoolean : BitwiseCompatibleDataType
178182
179183 public override object ? Divide ( object ? a , object ? b ) => throw new NotImplementedException ( ) ;
180184
185+ public override object ? Modulus ( object ? a , object ? b ) => throw new NotImplementedException ( ) ;
186+
181187 public override object ? BitwiseAnd ( object ? a , object ? b ) => throw new NotImplementedException ( ) ;
182188
183189 public override object ? BitwiseOr ( object ? a , object ? b ) => throw new NotImplementedException ( ) ;
@@ -205,6 +211,8 @@ private sealed class DbByte : BitwiseCompatibleDataType
205211
206212 public override object ? Divide ( object ? a , object ? b ) => throw new NotImplementedException ( ) ;
207213
214+ public override object ? Modulus ( object ? a , object ? b ) => throw new NotImplementedException ( ) ;
215+
208216 public override object ? BitwiseAnd ( object ? a , object ? b ) => throw new NotImplementedException ( ) ;
209217
210218 public override object ? BitwiseOr ( object ? a , object ? b ) => throw new NotImplementedException ( ) ;
@@ -232,6 +240,8 @@ private sealed class DbInt16 : BitwiseCompatibleDataType
232240
233241 public override object ? Divide ( object ? a , object ? b ) => throw new NotImplementedException ( ) ;
234242
243+ public override object ? Modulus ( object ? a , object ? b ) => throw new NotImplementedException ( ) ;
244+
235245 public override object ? BitwiseAnd ( object ? a , object ? b ) => throw new NotImplementedException ( ) ;
236246
237247 public override object ? BitwiseOr ( object ? a , object ? b ) => throw new NotImplementedException ( ) ;
@@ -286,6 +296,8 @@ private static bool TryToNative(object? rawA, object? rawB, out int a, out int b
286296
287297 public override object ? Divide ( object ? a , object ? b ) => TryToNative ( a , b , out var nativeA , out var nativeB ) ? nativeA / nativeB : null ;
288298
299+ public override object ? Modulus ( object ? a , object ? b ) => TryToNative ( a , b , out var nativeA , out var nativeB ) ? nativeA % nativeB : null ;
300+
289301 public override object ? BitwiseAnd ( object ? a , object ? b ) => TryToNative ( a , b , out var nativeA , out var nativeB ) ? nativeA & nativeB : null ;
290302
291303 public override object ? BitwiseOr ( object ? a , object ? b ) => TryToNative ( a , b , out var nativeA , out var nativeB ) ? nativeA | nativeB : null ;
0 commit comments