Basically, we always want to filter the documents by TerritoryId. And if there is no currentShiftId, we only want the documents where IsActive is set to true. Otherwise, we want all active documents and documents where any one of several properties match the currentShiftId.
Prior to the update, this behaved as expected. However, after the update, the query returns all documents with a matching TerritoryId if currentShiftId is null, even if they are not marked as active. If a currentShiftId is provided, the query returns the expected results.
This (admittedly convoluted)
Where()
condition in one of my Marten queries behaves differently after the upgrade:Basically, we always want to filter the documents by
TerritoryId
. And if there is nocurrentShiftId
, we only want the documents whereIsActive
is set totrue
. Otherwise, we want all active documents and documents where any one of several properties match thecurrentShiftId
.Prior to the update, this behaved as expected. However, after the update, the query returns all documents with a matching
TerritoryId
ifcurrentShiftId
is null, even if they are not marked as active. If acurrentShiftId
is provided, the query returns the expected results.