Skip to content

Conversation

AndyHeap-NeoTech
Copy link
Contributor

Before the fix the error reported when trying to map from, for example, a Vector to a Vector was:

System.InvalidOperationException: The expected value 'Neo4j.Driver.Vector'1[System.Single]' is different from the actual value 'System.Collections.Generic.List'1[System.Single]'

This was occurring because the ValueExtensions As method did not contain a clause for IVector, this caused the logic to fall through to the IEnumerable clause (which a vector implements) which converted the vector into a list, and then failed the type conversion on that list.

Now that a clause for IVector is added you get the correct error. e.g. For the Vector -> Vector example:

System.InvalidOperationException: The expected value 'Neo4j.Driver.Vector'1[System.Single]' is different from the actual value 'Neo4j.Driver.Vector'1[System.Double]'

…ils and a Vector type is involved.

Before the fix the error reported when trying to map from, for example, a Vector<float> to a Vector<double> was:
System.InvalidOperationException: The expected value `Neo4j.Driver.Vector`1[System.Single]` is different from the actual value `System.Collections.Generic.List`1[System.Single]`

This was occurring because the ValueExtensions As method did not contain a clause for IVector, this caused the logic to fall through to the IEnumerable clause (which a vector implements) which converted the vector into a list, and then failed the type conversion on that list.

Now that a clause for IVector is added you get the correct error. e.g. For the Vector<float> -> Vector<double> example:
System.InvalidOperationException: The expected value `Neo4j.Driver.Vector`1[System.Single]` is different from the actual value `Neo4j.Driver.Vector`1[System.Double]`
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.

1 participant