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
{{ message }}
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
Argument parser currently is only able to map scalar values. Attempting to use an object as an argument in [EntityResolver] leads to runtime errors.
[Key("bar { baz }")]publicclassFoo{publicFoo(Barbar,string?name){Bar=bar;Name=name;}publicBarbar{get;}publicstring?Name{get;}[ReferenceResolver]publicstaticFoo?GetFooByBarBaz{Bar bar,
Data repository){// TODO implement logicreturnnull;}}publicclassBar{publicBar(stringbaz){Baz=baz;}publicBazbaz{get;}}
Following workarounds are available
map scalar arguments instead
[ReferenceResolver]publicstaticFoo?GetFooByBarBaz([Map("bar.baz")]stringbaz
Data repository){// TODO implement logicreturnnull;}
instead of doing the auto mapping of arguments we process representation manually
[ReferenceResolver]publicstaticFoo?GetFooByBarBaz([LocalState]ObjectValueNodedata,Datarepository){// TODO implement logic by manually reading representation from datareturnnull;}
Quick question - for the "// TODO implement logic by manually reading representation from data" option - I've had a look at the source code and there appear to be a range of Parsers and Converters that might already do the job of converting from the ObjectValueNode entity representation to the relevant C# entity class. Any guidance on which is the right one? Alternatively I'll just copy/paste some of the existing Parser/Visitor code to handle it.
E.g. In the above, converting from ObjectValueNode to Foo
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Argument parser currently is only able to map scalar values. Attempting to use an object as an argument in
[EntityResolver]
leads to runtime errors.Following workarounds are available
Related #6
The text was updated successfully, but these errors were encountered: