Skip to content

Commit

Permalink
fix type validation condition
Browse files Browse the repository at this point in the history
  • Loading branch information
mseada94 committed Dec 27, 2024
1 parent 5694952 commit 6201a09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public SqlServerJsonFunctionsTranslator(ISqlExpressionFactory sqlExpressionFacto
IDiagnosticsLogger<DbLoggerCategory.Query> logger)
{
if (JsonExistsMethodInfo.Equals(method)
&& arguments[0].TypeMapping is not SqlServerOwnedJsonTypeMapping and not StringTypeMapping
&& arguments[0].TypeMapping is SqlServerOwnedJsonTypeMapping or StringTypeMapping
&& _sqlServerSingletonOptions.EngineType == SqlServerEngineType.SqlServer
&& _sqlServerSingletonOptions.SqlServerCompatibilityLevel >= 160)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public SqliteJsonFunctionsTranslator(ISqlExpressionFactory sqlExpressionFactory)
IDiagnosticsLogger<DbLoggerCategory.Query> logger)
{
if (JsonExistsMethodInfo.Equals(method)
&& arguments[0].TypeMapping is not SqliteJsonTypeMapping and not StringTypeMapping)
&& arguments[0].TypeMapping is SqliteJsonTypeMapping or StringTypeMapping)
{
// IIF(arguments_0 IS NULL, NULL, JSON_TYPE(arguments_0, arguments_1) IS NOT NULL)
return _sqlExpressionFactory.Function("IFF",
Expand Down

0 comments on commit 6201a09

Please sign in to comment.