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

Get Object from Javascript as .NET ExpandoObject #217

Open
mb-software opened this issue May 7, 2020 · 1 comment
Open

Get Object from Javascript as .NET ExpandoObject #217

mb-software opened this issue May 7, 2020 · 1 comment
Labels

Comments

@mb-software
Copy link

mb-software commented May 7, 2020

Hi and thanks a lot for this great library!

I'm trying to get an Object from Javascript and convert it to a .NET System.Dynamics.ExpandoObject. Is there any solution for this? For example I call this .NET function from my JS, passing an Object as parameter:

public void test(JSValue obj)
{
// this unfortunately does not work, it returns null
Object clrObj = obj.As<ExpandoObject>()
}

Thanks!

EDIT:
It seems we can pass an ExpandoObject to JS:
https://github.com/nilproject/NiL.JS/blob/develop/FunctionalTests/ExpandoObjectTests.cs

But what about the other way round?

@nilproject
Copy link
Owner

Hi! Sorry for the lag.
No, there is no embedded converter or wrapper from JS object to. And in general, support of ExpandoObject and similar types is "not as good as we would like" because of all mechanisms in .NET platform for them (i mean dynamic) brings to significant performance penalty and rarely used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants