-
Notifications
You must be signed in to change notification settings - Fork 933
Fix subquery "Item with Same Key has already been added” exception for Linq provider #2664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -317,8 +317,8 @@ protected HqlTreeNode VisitBinaryExpression(BinaryExpression expression) | |||
var rightType = GetExpressionType(expression.Right); | |||
if (leftType != null && leftType == rightType) | |||
{ | |||
_notCastableExpressions.Add(expression.Left, leftType); | |||
_notCastableExpressions.Add(expression.Right, rightType); | |||
_notCastableExpressions.TryAdd(expression.Left, leftType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TryAdd is not available in .net standard 2.0 and .net 4.6.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an extension method for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maca88 can we replace Add with Set?
_notCastableExpressions[expression.Right] = rightType;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow I overlooked the comment. Yes we can, replaced with Set.
Also now I realized that I created the branch to this repository instead on my fork. We should remove the branch after merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow I overlooked the comment.
This is what I thought.
@maca88 one last question from me, see in the comments section. |
…r Linq provider (nhibernate#2664) Fixes nhibernate#2659
Fixes #2659