File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/NHibernate/Linq/Visitors Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ protected HqlTreeNode VisitExpression(Expression expression)
106
106
return VisitParameterExpression ( ( ParameterExpression ) expression ) ;
107
107
case ExpressionType . TypeIs :
108
108
return VisitTypeBinaryExpression ( ( TypeBinaryExpression ) expression ) ;
109
+ case ExpressionType . Dynamic :
110
+ return VisitDynamicExpression ( ( DynamicExpression ) expression ) ;
109
111
110
112
case ExpressionType . Extension :
111
113
switch ( expression )
@@ -143,6 +145,19 @@ protected HqlTreeNode VisitExpression(Expression expression)
143
145
}
144
146
}
145
147
148
+ private HqlTreeNode VisitDynamicExpression ( DynamicExpression expression )
149
+ {
150
+ switch ( expression . Binder )
151
+ {
152
+ case GetMemberBinder binder :
153
+ return _hqlTreeBuilder . Dot (
154
+ VisitExpression ( expression . Arguments [ 1 ] ) . AsExpression ( ) ,
155
+ _hqlTreeBuilder . Ident ( binder . Name ) ) ;
156
+ }
157
+
158
+ throw new NotSupportedException ( $ "Dynamic expression with a binder of { expression . Binder . GetType ( ) } is not supported") ;
159
+ }
160
+
146
161
private HqlTreeNode VisitTypeBinaryExpression ( TypeBinaryExpression expression )
147
162
{
148
163
return BuildOfType ( expression . Expression , expression . TypeOperand ) ;
You can’t perform that action at this time.
0 commit comments