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

Using DynamicObject as Expression Owner #78

Open
themightylc opened this issue Jun 29, 2020 · 2 comments
Open

Using DynamicObject as Expression Owner #78

themightylc opened this issue Jun 29, 2020 · 2 comments

Comments

@themightylc
Copy link

I seem to be unable to use a DynamicObject (IExpando, IDynamic) with dynamic members as Expression owner.
At runtime, (property) member foo exits and can be evaluated by .NET, but using it as Expression owner results in

Flee.PublicTypes.ExpressionCompileException IdentifierElement: Could not find a field/property/variable with the name 'foo'

Is this intended? Do I need to wrap the Object and write a member accessor?

@hunkydoryrepair
Copy link
Contributor

Flee uses reflection and DynamicObject properties are not properties visible by reflection.
You can add variables at runtime to the context, or you can implement a function to access dynamic properties.

@eng-marani
Copy link

I'm facing too the same issue. Extending flee to allow expando objects to be understood as properties would be a very handy feature. A diffferent approach would be to decorate a specific function on the owner where to pass statically the property name as string every time it is not resolved by reflection, so i can calculate the result runtime even without involving any expando object to be pre-filled. Is this project actively maintained ? I would love to collaborate for implementing such a feature.

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

3 participants