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

Allow External Libraries to add functionality to Cypher Generation #409

Open
adam8797 opened this issue May 24, 2021 · 0 comments
Open

Allow External Libraries to add functionality to Cypher Generation #409

adam8797 opened this issue May 24, 2021 · 0 comments

Comments

@adam8797
Copy link
Contributor

Ok Ok, before you freak out at how big this change could be, I mostly want this to track work. If I've got time, I'd like to contribute to this solution, but I figure as an expert on the library you might have some input.

Right now I maintain a few extensions in a library I call Neo4jClient.ReturnPoly that essentially allow you to setup a type hierarchy in c# and then reflect that in Nodes and Tags.

And so far its worked great without any modifications to the base library, just a handful of extensions and JsonConverters.

However, I've recently been working on doing this conversion in Anonymous or built types (.Return(() => new { ... }) ) and I've run into a bit of a snag. I've found a way to do it, but it requires end users to go and use Return.As<T>(string) and chain it with a static method: .Return(() => new { Data = Return.As<MyType>(PolyUtils.Poly("n")) }); which is just a little too verbose.

I'd like to see a way where I can kind of hook into the Cypher Generation code, or provide a type that it knows how to convert.

What I would like to be able to do is .Return(n => new { Data = n.AsPoly<MyType>() }) where I would provide the AsPoly method in an external library, then the cypher generation would also just hook my library for the actual implementation.

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

No branches or pull requests

1 participant