Beispiel #1
0
        public async Task TableQueryableComplexFilterWithCreateFilter()
        {
            var entitiesToCreate = CreateComplexTableEntities(PartitionKeyValue, 4);

            // Create the new entities.

            await CreateTestEntities(entitiesToCreate).ConfigureAwait(false);

            var filter  = TableClient.CreateFilter <ComplexEntity>(ent => (ent.RowKey == "0004" && ent.Int32 == 4) || ((ent.Int32 == 2) && (ent.String == "wrong string" || ent.Bool == true)) || (ent.LongPrimitiveN == (long)int.MaxValue + 50));
            var results = await client.QueryAsync <ComplexEntity>(filter).ToEnumerableAsync().ConfigureAwait(false);

            foreach (ComplexEntity ent in results)
            {
                Assert.IsTrue(ent.Int32 == 4 || ent.Int32 == 2);
            }

            Assert.That(results.Count, Is.EqualTo(2));
        }
Beispiel #2
0
        public void TestDynamicTableEntityFilterExpressions(string expectedFilter, Expression <Func <DynamicTableEntity, bool> > expression)
        {
            var filter = TableClient.CreateFilter(expression);

            Assert.That(filter, Is.EqualTo(expectedFilter));
        }