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

DynamicExpression accessibility #22

Closed
rpaschoal opened this issue Jun 4, 2016 · 5 comments
Closed

DynamicExpression accessibility #22

rpaschoal opened this issue Jun 4, 2016 · 5 comments
Assignees
Labels

Comments

@rpaschoal
Copy link

Hello,

First of all, thank you for all your effort porting this project to .NET Core.

Is there any chance you could make DynamicExpression class public? The reason for that is because I use "ParseLambda" method to generate dynamic filters in an application by using PredicateBuilders.

Many Thanks.

@StefH
Copy link
Collaborator

StefH commented Jun 4, 2016

please verify

@rpaschoal
Copy link
Author

Hello @StefH,

Thanks for the quick reply and change to the API.

I can see the signature is a little bit different. This is how I use on the original Linq.Dynamic:

System.Linq.Dynamic.DynamicExpression.ParseLambda<Entity, bool>(expression, null)

Where "Entity" is the type of the code-first entity and "expression" is a string with many linq expressions.

Following your API, would this produce the same output?

System.Linq.Dynamic.Core.DynamicExpression.ParseLambda(false, typeof(Entity), typeof(bool), expression, null)

Oh, by the way, after calling that I had to parse a LinqExpression to an Expression using this:

var typedExpression1 = (Expression<Func<Entity, bool>>) Expression.Lambda(expression1, null);

Now it compiles, not sure if it works yet. Need to test it.

Thanks!

@StefH
Copy link
Collaborator

StefH commented Jun 5, 2016

Correct, I changed the interface and the internal business logic a bit.

When calling the new API, just use
DynamicExpression.ParseLambda(false, typeof(Entity), null, expression)

See https://system-linq-dynamic-core.azurewebsites.net/html/938537c7-8fa2-b300-1f27-5aadcd5440e5.htm for details:

@rpaschoal
Copy link
Author

Thanks Mate,

I have simplified my call.

Cheers 👍

@StefH StefH closed this as completed Jun 6, 2016
@StefH
Copy link
Collaborator

StefH commented Jun 8, 2016

Note that in the latest version, this class has been renamed to DynamicExpressionParser to avoid naming conflicts.

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

No branches or pull requests

2 participants