-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Request for contribution #230
Comments
Do you know the project https://github.com/esskar/Serialize.Linq ? This tool can also be used to serialize a linq expression, however I did never test if this one also supports dynamic lambda expressions. |
I do know about that project, but it generates very heavy serialized lambda expressions. I am using it in some places though. I'll upload a repo with the library so you can take a closer look at what it does. It was mostly designed to convert in-place lambda expressions to the input required by Dynamic.Linq.Core which is a text based expression + the list of arguments. |
OK. I'm curious to see how this is implemented. |
This is it: https://github.com/david-garcia-garcia/LambdaTextExpression I just moved it way from the project where it is embeded, would need some extra work actually make this seomthing really stand-alone with proper test coverage. Y had to comment several tests where DTO's from another project are used. |
Interesting. Do you need And if you need help, I can help you converting this library into a NETStandard library and also adding some more tests if needed. |
Dynamitey is used to ease som reflection based operations, of course they could be implemented excusively using reflection, but that would be more teidous |
@david-garcia-garcia What is the status of this? As I noted in #423, I've written a library that produces various string representations of expression trees, and I would like to include something similar to what you've done. |
We've been working on a internal tool that converts lambda expressions to text-based expressions that are compatible with this library (System.Linq.Dynamic.Core).
Original implementation was inspired by:
https://github.com/aspnet/Mvc/blob/9c545aa343ccb1bf413888573c398fe56017d9ee/src/Microsoft.AspNet.Mvc.Core/Rendering/Expressions/ExpressionHelper.cs
I think this would be an interesting addition to Dynamic.Linq.Core as it provides a way to convert LambdaExpressions to strings that can be used by Dynamic.Linq.Core.
It's kind of the opposite of what LambdaParser does.
Of course it's a bit more complex (not only converts to string, but extracts the arguments and parameters) that what is shown here, but I just paste relevant usage code so that maintainer can evaluate if a formal PR will have any chance.
An example of part of the test coverage we have for this tool:
The text was updated successfully, but these errors were encountered: