Exemplo n.º 1
0
        public void CanSelectDistinctUsingPropertyHelper()
        {
            FlowQuerySelection <RoleEnum> roles = Query <UserEntity>()
                                                  .Distinct()
                                                  .Select(x => Property.As <RoleEnum>("x.Role"));

            Assert.That(roles.Count(), Is.EqualTo(3));
        }
Exemplo n.º 2
0
        public void CanSelectUsingPropertyHelper()
        {
            FlowQuerySelection <UserEntity> users = Query <UserEntity>()
                                                    .Select(u => new UserEntity
            {
                Id = Property.As <long>("u.Id")
            });

            Assert.That(users.Count(), Is.EqualTo(4));

            foreach (UserEntity item in users)
            {
                Assert.That(item.Id, Is.Not.EqualTo(0));
            }
        }