DotNet4Neo4j / Neo4jClient

.NET client binding for Neo4j
https://www.nuget.org/packages/Neo4jClient
Microsoft Public License
431 stars 146 forks source link

WithParam: throw exception if parameter starts with '$' (or any other not allowed character) #458

Closed Clooney24 closed 1 year ago

Clooney24 commented 1 year ago

Hi Charlotte,

we often copy & paste parameter names and it happens quite frequently that the parameter name including the leading '$' is pasted into the WithParam statement. Currently, we only recognise this in unwanted data behaviour if we are lucky. It would be more safe if an exception is thrown.

If you agree, I will create a PR with tests that covers the part of the Neo4j doc stating: "Parameters [...], but cannot start with a number or a currency symbol."

To not break anything: Do we still need to allow the old syntax with { } around params?

Best, Reiner

Clooney24 commented 1 year ago

Please ignore that question about old syntax with { } around params - anyways the param name itself should not contain those characters despite of how it is implemented in query text.

PR created: https://github.com/DotNet4Neo4j/Neo4jClient/pull/460

cskardon commented 1 year ago

5.1.5 is in nuget now with the changes