Ejemplo n.º 1
0
        public override Task DateTimeOffset_Contains_Less_than_Greater_than(bool async)
        {
            var dto   = GearsOfWarQueryMySqlFixture.GetExpectedValue(new DateTimeOffset(599898024001234567, new TimeSpan(1, 30, 0)));
            var start = dto.AddDays(-1);
            var end   = dto.AddDays(1);
            var dates = new[] { dto };

            return(AssertQuery(
                       async,
                       ss => ss.Set <Mission>().Where(
                           m => start <= m.Timeline.Date && m.Timeline < end && dates.Contains(m.Timeline))));
        }
Ejemplo n.º 2
0
        public override Task Where_datetimeoffset_milliseconds_parameter_and_constant(bool async)
        {
            var dateTimeOffset = GearsOfWarQueryMySqlFixture.GetExpectedValue(new DateTimeOffset(599898024001234567, new TimeSpan(1, 30, 0)));

            // Literal where clause
            var p            = Expression.Parameter(typeof(Mission), "i");
            var dynamicWhere = Expression.Lambda <Func <Mission, bool> >(
                Expression.Equal(
                    Expression.Property(p, "Timeline"),
                    Expression.Constant(dateTimeOffset)
                    ), p);

            return(AssertCount(
                       async,
                       ss => ss.Set <Mission>().Where(dynamicWhere),
                       ss => ss.Set <Mission>().Where(m => m.Timeline == dateTimeOffset)));
        }