public override byte[] EncodeValue(ScalarValue value)
        {
            if (value.IsNull)
            {
                return(NullValueEncoding);
            }

            var intValue = (NumericValue)value;

            if (intValue.ToLong() >= 0)
            {
                return(Integer.EncodeValue(intValue.Increment()));
            }
            return(Integer.EncodeValue(intValue));
        }
Esempio n. 2
0
 public override byte[] EncodeValue(ScalarValue value)
 {
     return(Integer.EncodeValue(new LongValue(value.ToLong())));
 }
 public override byte[] EncodeValue(ScalarValue value)
 {
     DateTime date = ((DateValue) value).Value;
     var millisecondsSinceMidnight = (int) date.TimeOfDay.TotalMilliseconds;
     return Integer.EncodeValue(new IntegerValue(millisecondsSinceMidnight));
 }