Skip to content
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

Detects when a MemberExpression returns null and adjusts it as a ConstantExpression #38

Merged

Conversation

arturosevilla
Copy link
Contributor

Neo4j doesn't consider null as valid values for PropertyBags
(relationships and nodes).

Neo4jClient could have a MemberExpression in a Where() construct and it
could detect it if was in reality a ConstantExpression, however it just
sends the value as parameter regardless if it's a null value.

This commit fixes that by having the same behavior that occurs in
VisitConstant(ConstantExpression) if it detects a null value.

…tantExpression

Neo4j doesn't consider null as valid values for PropertyBags
(relationships and nodes).
Neo4jClient could have a MemberExpression in a Where() construct and it
could detect it if was in reality a ConstantExpression, however it just
sends the value as parameter regardless if it's a null value.

This commit fixes that by having the same behavior that occurs in
VisitConstant(ConstantExpression) if it detects a null value.
}
else
{
TextOutput.Remove(TextOutput.ToString().LastIndexOf(lastWrittenMemberName, StringComparison.Ordinal), lastWrittenMemberName.Length);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic branch isn't tested.

The unit tests from the last commit was moved from the
CypherFluentQueryWhereTests to CypherWhereExpressionBuilderTests and added
three more unit tests for all logic branches within this method.
@arturosevilla
Copy link
Contributor Author

I added the missing unit tests.

tathamoddie added a commit that referenced this pull request Mar 6, 2014
Detects when a MemberExpression returns null and adjusts it as a ConstantExpression
@tathamoddie tathamoddie merged commit e8f7c19 into DotNet4Neo4j:master Mar 6, 2014
@tathamoddie
Copy link
Contributor

This will be automatically deployed to NuGet in about 60 seconds.

@arturosevilla arturosevilla deleted the nullinmemberexpressionfix branch March 14, 2014 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants