You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 useReturn.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.The text was updated successfully, but these errors were encountered: