The NorthwindWhereQueryTestBase.Where_equals_*_on_mismatched_types tests assert that equality between two different numeric CLR types must return false. Mongo naturally handles these comparisons, as do other databases. It seems inline with EF Core philosophy that we allow these comparisons to translate.
The behavior was determined by-design in 2015 with #1858: Filter missing if wrong type passed in. This was a long time ago and I suspect the full consequences were not properly understood, or may have been dismissed because of the complexity of handling this in the LINQ provider at that time.
We could choose to include floating point comparisons or not, since this might not work as the user intended, just like with any float comparisons.
The
NorthwindWhereQueryTestBase.Where_equals_*_on_mismatched_typestests assert that equality between two different numeric CLR types must return false. Mongo naturally handles these comparisons, as do other databases. It seems inline with EF Core philosophy that we allow these comparisons to translate.The behavior was determined by-design in 2015 with #1858: Filter missing if wrong type passed in. This was a long time ago and I suspect the full consequences were not properly understood, or may have been dismissed because of the complexity of handling this in the LINQ provider at that time.
We could choose to include floating point comparisons or not, since this might not work as the user intended, just like with any float comparisons.