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

Add support and/or documentation for anonymous IQueryable #120

Open
JasonImageOne opened this issue Jun 29, 2020 · 0 comments
Open

Add support and/or documentation for anonymous IQueryable #120

JasonImageOne opened this issue Jun 29, 2020 · 0 comments

Comments

@JasonImageOne
Copy link

JasonImageOne commented Jun 29, 2020

Although I found a way to do this, it would be better if I could just initialize an ExpressionStarter more directly.

This is currently the round about way to do it:

var query = (from u in db.Users join d in db.Docs on u.DocId equals u.Id select new { DocName = d.Name, User = d.Username }.AsQueryable();

And then here we make a function so we can use our IQueryable:

private static ExpressionStarter<T> MakePredicate<T>(IQueryable<T> ignored) { return PredicateBuilder.New<T>(); }

var predicate = MakePredicate(query); predicate = predicate.Or(d => d.Username == someVar); query = query.AsExpandable().Where(predicate);

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

1 participant