예제 #1
0
        public void Can_get_Scalar_Enum_Flag()
        {
            using var db = OpenDbConnection();
            db.DropAndCreateTable <TypeWithFlagsEnum>();

            var row = new TypeWithFlagsEnum {
                Id = 1, Flags = FlagsEnum.FlagTwo
            };

            db.Insert(row);

            row.PrintDump();

            var flagsEnum = db.Scalar <FlagsEnum>(db.From <TypeWithFlagsEnum>()
                                                  .Where(o => o.Id == row.Id)
                                                  .Select(o => o.Flags));

            Assert.That(flagsEnum, Is.EqualTo(FlagsEnum.FlagTwo));
        }
예제 #2
0
        public void Can_get_Scalar_Enum_Flag()
        {
            using (var db = OpenDbConnection())
            {
                db.DropAndCreateTable<TypeWithFlagsEnum>();

                var row = new TypeWithFlagsEnum { Id = 1, Flags = FlagsEnum.FlagTwo };
                db.Insert(row);

                row.PrintDump();

                var flagsEnum = db.Scalar<FlagsEnum>(db.From<TypeWithFlagsEnum>()
                    .Where(o => o.Id == row.Id)
                    .Select(o => o.Flags));

                Assert.That(flagsEnum, Is.EqualTo(FlagsEnum.FlagTwo));
            }
        }