Beispiel #1
0
 public static SqlExpression DateTimeCtor(
     [Type(typeof(int))] SqlExpression year,
     [Type(typeof(int))] SqlExpression month,
     [Type(typeof(int))] SqlExpression day)
 {
     return(SqlDml.DateTimeConstruct(year, month, day));
 }
        public virtual void DateTimeConstructTest()
        {
            var select = SqlDml.Select();

            select.Columns.Add(
                SqlDml.DateTimeConstruct(2005, 5, 5));
            select.Columns.Add(new DateTime(2005, 5, 5));
            CompareColumnEquality(select);
        }
Beispiel #3
0
        public void Test014_13()
        {
            string nativeSql = @"select datetime('2011-11-16') AS BirthDay ";

            SqlSelect select = SqlDml.Select();

            select.Columns.Add(SqlDml.DateTimeConstruct(2011, 11, 16), "BirthDay");

            Assert.IsTrue(CompareExecuteDataReader(nativeSql, select));
        }
Beispiel #4
0
 private static SqlExpression DateTimeConstruct(
     SqlExpression year,
     SqlExpression month,
     SqlExpression day,
     SqlExpression hour,
     SqlExpression minute,
     SqlExpression second,
     SqlExpression millisecond)
 {
     return(SqlDml.DateTimePlusInterval(
                SqlDml.DateTimeConstruct(year, month, day),
                TimeSpanCompilers.GenericIntervalConstruct(0, hour, minute, second, millisecond)));
 }
 public virtual void DateTimeConstructTest()
 {
     CheckEquality(
         SqlDml.DateTimeConstruct(DefaultDateTime.Year, DefaultDateTime.Month, DefaultDateTime.Day),
         DefaultDateTime.Date);
 }