Hi Tom,
I've converted this question into a bug report and passed it to our development team. We'll notify you about our progress on this issue.
Thanks,
Uriah.
Hi Tom,
Sorry, we can't address this problem. When the LINQ expression is processed by XPO, the value of the variable isn't yet recognized and we can't determine whether the variable has a value. So, the query is transformed in the BinaryOperator. The BinaryOperator always returns False, if the OperatorType is BinaryOperator.Equal and the RightOperand is null. This is by design, because different SQL server handle the comparison with null values in a different manner. To resolve this problem, I suggest that you manually check whether the value of the variable is null:
[C#]int count = new XPQuery<MemberGroup>(session).Where( mg => mg.Oid == ag.MemberGroup.Oid && ( ag.MemberGroup.ParentMemberGroup == null ? mg.ParentMemberGroup == null : mg.ParentMemberGroup == ag.MemberGroup.ParentMemberGroup ) ).Count();
Thanks,
Uriah.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.
Facebook
Twitter
Google+