Beispiel #1
0
        public async Task ShouldGetQueryByListFilter()
        {
            await WithUnitOfWorkAsync(async() =>
            {
                // Arrange
                var filters = new DynamicQueryGroup
                {
                    Type       = GroupType.Add,
                    Conditions = new List <DynamicQueryCondition>
                    {
                        new DynamicQueryCondition {
                            FieldName = "price", Operator = DynamicQueryOperator.GreaterOrEqual, Value = 200
                        }
                    },
                };

                // Act
                var output = await _dynamicEntityRepository.ExecuteDynamicQuery(filters).ToListAsync();

                // Assert
                output.Count.ShouldBe(1);
                output[0].GetProperty("Name", "Book2");
            });
        }
Beispiel #2
0
 protected override IQueryable <DynamicEntity> CreateFilteredQuery(GetListInput input)
 {
     return(_repository.ExecuteDynamicQuery(input.FilterGroup));
 }