From bc5b51fa4a873873d382276c2706dd7fc5c4c73b Mon Sep 17 00:00:00 2001 From: Christopher Jolly Date: Thu, 20 Apr 2023 01:20:30 +0800 Subject: [PATCH] Fix check against typeof JetBoolTypeMapping. For the tests Everything is Bytes/Strings all type mappings are the same which makes the check not behave correctly --- src/EFCore.Jet/Query/Sql/Internal/JetQuerySqlGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EFCore.Jet/Query/Sql/Internal/JetQuerySqlGenerator.cs b/src/EFCore.Jet/Query/Sql/Internal/JetQuerySqlGenerator.cs index 3b1af50..3a8100d 100644 --- a/src/EFCore.Jet/Query/Sql/Internal/JetQuerySqlGenerator.cs +++ b/src/EFCore.Jet/Query/Sql/Internal/JetQuerySqlGenerator.cs @@ -250,7 +250,7 @@ namespace EntityFrameworkCore.Jet.Query.Sql.Internal // Jet uses the value -1 as True, so ordering by a boolean expression will first list the True values // before the False values, which is the opposite of what .NET and other DBMS do, which are using 1 as True. - if (orderingExpression.Expression.TypeMapping?.GetType() == _boolTypeMapping?.GetType()) + if (orderingExpression.Expression.TypeMapping?.GetType() == typeof(JetBoolTypeMapping)) { orderingExpression = new OrderingExpression( new SqlUnaryExpression(