示例#1
0
        public void CreateDateTimeOffset()
        {
            this.context.DateTimeOffsetFieldEntities.Add(
                new DateTimeOffsetFieldEntity()
            {
                Offset = DateTimeOffset.Now
            });

            this.context.SaveChanges();

#if !EFOLD
            var q = this.Entities
                    .Select(x =>
                            DbFunctions.CreateDateTimeOffset(x.Offset.Year, 1, 1, 0, 0, 0, 60));
#else
            var q = this.Entities
                    .Select(x =>
                            EntityFunctions.CreateDateTimeOffset(x.Offset.Year, 1, 1, 0, 0, 0, 60));
#endif

            var q2 = q.AsEnumerable().Where(x => x.Value.Offset.TotalHours == 1);

            q.Should().NotBeEmpty();
        }