-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Change type of expression when deserializing #4
Comments
hi, this could be a nice feature. let me think about it, and i will integrate it in the next version. cheers, esskar |
We'll, I'm thinking & playing with this idea and while it may work for simple & flat DTOs, it will be more difficult to achieve for complex cases:
In my case, I'm thinking now to reference in one way or another my server side domain from the client and use it to build queries... |
i have 2 ideas:
|
On options: 1 - I think the effort will not justify the outcome. Flexible Fluent APIs are not easy to build, there are many pieces to be tied together. 2nd option opens another interesting scenario: turning an incoming JSON doc (or a simple string) with a query definition and execute it as an Expression<>. Take say, a query string from a web request, execute it on a IQueryable and return results... Like OData :) |
I have the same problem. Fixed comment .. Sorry, need TSource, TResult referenced... A very good job, esskar! |
I added a |
it probably didn't. but here is the deal. I made the |
Ok. However, this improvement is not a critical point. I can use AutoMapper mapping (with internal mapped "errors") the resulting expression, after replacing namespaces dto to domain entities. I understand that "ConcurrentDictionary <string, ParameterExpression>" in ExpressionContext dictionary is serialized as a string expression and its parameters. Is that true? Because if so, I think your solution is perfectly valid. THANKS! |
ahhh, sorry for that. commited wrong. |
I tried basically. Now we can modify the expression delegating or driving context. |
cool. |
Scenario:
Now I want to deserialize expression and have the func executed over the my domain entity.
I got it working with serializing to json and doing a
string.Replace(typeof(DTO).FullName, typeof(Entity).FullName)
Is it the only way to achieve it?
Any pitfalls I may run in?
Thanks
The text was updated successfully, but these errors were encountered: