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

Any plans to allow Predicate and Expressions in the query language? #35

Open
mps opened this issue Sep 17, 2010 · 0 comments
Open

Any plans to allow Predicate and Expressions in the query language? #35

mps opened this issue Sep 17, 2010 · 0 comments

Comments

@mps
Copy link

mps commented Sep 17, 2010

Any plans to allow something like this?

var linq = new List<Predicate> { c => c.OwnerId== criteria.OwnerId, };

        if (criteria.Status.HasValue)
            linq.Add(c => c.StatusCd == criteria.Status.Value);
        if (!string.IsNullOrEmpty(criteria.Source))
            linq.Add(c => c.Source == criteria.Source);
        Expression<Func<Client, bool>> where = p => linq.All(pred => pred(p));
        return Session.All<Client>().Where(where).OrderByDescending(c => c.ModifiedDt).ToList();
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