You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NORM cannot handle expressions where the type is an interface type.
For example, in a generic class that has an interface constraint on the type, when I access a property of T, e.g. ".UniqueIdentifier" NORM cannot handle the expression and an Exception is thrown (relating to its inability to case a UnaryExpression to a ParameterExpression).
var existing = db.GetCollection<T>().AsQueryable().SingleOrDefault(x => x.UniqueIdentifier == uid);
In this expression 'x.UniqueIdentifier' has a NodeType=Convert wrapped around it to perform the cast to the interface.
It's actually a fairly simple fix: In MongoQueryTranslator.cs, about line 407 there is an if statement in ...
NORM cannot handle expressions where the type is an interface type.
For example, in a generic class that has an interface constraint on the type, when I access a property of T, e.g. ".UniqueIdentifier" NORM cannot handle the expression and an Exception is thrown (relating to its inability to case a UnaryExpression to a ParameterExpression).
In this expression 'x.UniqueIdentifier' has a NodeType=Convert wrapped around it to perform the cast to the interface.
It's actually a fairly simple fix: In MongoQueryTranslator.cs, about line 407 there is an if statement in ...
Adding the following clause to the if statement solves the problem:
The text was updated successfully, but these errors were encountered: