1

In one code i had the following filter Definition (filter is a instance of FilterDefinitionBuiler<T> )

  filter = Filter.And(
  Filter.Eq(x => x.CompanyId, companyId),
  Filter.Eq(x => x.DepartureProviderUniqueValue, departureValue),
  Filter.Eq(x => x.ArrivalProviderUniqueValue, arrivalValue),

Now If a condition is met I want to extend the query I did it like this

if(date > DateTime.Min)
{
     filter= Filter.And(filter, Filter.Eq(x => x.DepartureDate, date));
}

but When I run the query it behaves like the first conditions were concated with an OR instead of a AND. I would understand it would behave like a nested clause, but as all conditions are connected with AND.

Any explanations? What am I doing wrong?

Kirill Rakhman
  • 42,195
  • 18
  • 124
  • 148
Boas Enkler
  • 12,264
  • 16
  • 69
  • 143
  • Hi Boas, I can't reproduce this. It always comes out as an conjunction for me. Could you call `filter.Render(BsonSerializer.SerializerRegistry.GetSerializer(), BsonSerializer.SerializerRegistry)` and provide the string output of the result? – Craig Wilson May 23 '16 at 14:11

0 Answers0