private ISqlValue ToBinary(SqlDayToSecond dts, SqlBinaryType destType)
        {
            var bytes  = dts.ToByArray();
            var binary = new SqlBinary(bytes);

            return(destType.NormalizeValue(binary));
        }
Exemple #2
0
        public static void GetBinary(int days, int hours, int minutes, int seconds, int millis)
        {
            var dts = new SqlDayToSecond(days, hours, minutes, seconds, millis);

            var bytes = dts.ToByArray();

            Assert.NotNull(bytes);
            Assert.Equal(20, bytes.Length);

            var back = new SqlDayToSecond(bytes);

            Assert.Equal(dts.Days, back.Days);
            Assert.Equal(dts.Hours, back.Hours);
            Assert.Equal(dts.Minutes, back.Minutes);
            Assert.Equal(dts.Seconds, back.Seconds);
            Assert.Equal(dts.Milliseconds, back.Milliseconds);
        }