Skip to content

Commit 45fc73b

Browse files
committed
Fix .NET 10: handle op_Implicit in expression tree for enum Contains
.NET 10 generates op_Implicit conversion nodes in expression trees when calling Contains on enum arrays. Added handler in both SQLite and Postgres WhereBuilders to visit through the implicit conversion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d73c916 commit 45fc73b

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/NzbDrone.Core/Datastore/WhereBuilderPostgres.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ protected override Expression VisitMethodCall(MethodCallExpression expression)
7575
ParseEndsWith(expression);
7676
break;
7777

78+
case "op_Implicit":
79+
// .NET 10 inserts implicit conversion nodes for enum arrays
80+
Visit(expression.Arguments[0]);
81+
break;
82+
7883
default:
7984
var msg = string.Format("'{0}' expressions are not yet implemented in the where clause expression tree parser.", method);
8085
throw new NotImplementedException(msg);

src/NzbDrone.Core/Datastore/WhereBuilderSqlite.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ protected override Expression VisitMethodCall(MethodCallExpression expression)
7575
ParseEndsWith(expression);
7676
break;
7777

78+
case "op_Implicit":
79+
// .NET 10 inserts implicit conversion nodes for enum arrays
80+
Visit(expression.Arguments[0]);
81+
break;
82+
7883
default:
7984
var msg = string.Format("'{0}' expressions are not yet implemented in the where clause expression tree parser.", method);
8085
throw new NotImplementedException(msg);

0 commit comments

Comments
 (0)