Allows you to dynamically composing expression predicates to be used in WHERE clauses in LINQ and also in EntityFramework.
Questions tagged [predicatebuilder]
241 questions
0
votes
1 answer
Dynamic Sorting with PredicateBuilder
I am using PredicateBuilder to dynamically construct LINQ query as below.
I can easily add filter expression usingPredicateBuilder, but I cannot find a way to add dynamic sorting using PredicateBuilder. For example, in code below I would like sort…

Sunil
- 20,653
- 28
- 112
- 197
0
votes
1 answer
predicate not working in join lambda expression
I have using PredicateBuilder class to dynamically creating Where clause in LINQ statements.
Following is my code which is When using predicate
var predicate = PredicateBuilder.True();
predicate = predicate.And(x => x.DAT_LOGIN_TIME >=…

Rajeev Kumar
- 4,901
- 8
- 48
- 83
0
votes
1 answer
How to use LINQ and PredicateBuilder to build a predicate using a subclass?
I am trying to use this answer to dynamically add an OR operator to the WHERE clause in LINQ: https://stackoverflow.com/a/782350/1316683
var searchPredicate = PredicateBuilder.False();
foreach(string str in strArray)
{
var…

MDave
- 1,245
- 13
- 29
0
votes
1 answer
Dynamic Linq Library can't handling one on many relationship in select clause
I would like to get records from the database using Dynamic Linq Library NuGet. How can I write query for select parent records along with list of child records. For example there is One-on-Many relationship between Question and Answers table.…

sridharnetha
- 2,104
- 8
- 35
- 69
0
votes
1 answer
LinqKit PredicateBuilder adding to linq query
I have a linq query which I want to add some additional, optional WHERE conditions to using LinqKit Predicate Builder. However, I an struggling to get the additional predicate to work
This is my initial query:
var query = (from OP in…

Chris Walsh
- 3,423
- 2
- 42
- 62
0
votes
1 answer
Linq In Clause & Predicate building
I have two tables. Report and ReportData.
ReportData has a constraint ReportID.
How can I write my linq query to return all Report objects where the predicate conditions are met for ReportData? Something like this in SQL:
SELECT * FROM Report as…

Michael G
- 6,695
- 2
- 41
- 59
0
votes
1 answer
Breeze.js Passthrough Predicate Odata Url
I am attempting to create an odata url with multiple breeze.js passthrough predicates using documentation from the folowing link: http://www.getbreezenow.com/documentation/query-using-json.
However the generated url looks nothing like an odata url…
0
votes
1 answer
Predicate Builder remove predicate based on other predicate
I have some entities that have a IsDeleted (logic delete) property and when I do queries, the standard would be to return all but deleted ones, like:
var query = collection.Where(e=> !e.IsDeleted);
I'm using predicate builder to create some…

Bart Calixto
- 19,210
- 11
- 78
- 114
0
votes
0 answers
PredicateBuilder with multiple (OR) and (AND)
I'm trying to create an expression in order to retrieve a Store object that should be on a list of countries and also that their Store.Id = X.
I'm trying to do that with the following expression, but that returns all Stores stored on the database, I…

user1520494
- 1,134
- 2
- 11
- 27
0
votes
0 answers
binbin ling predicatebuilder trying to add a AND (field1 = string1 or field1 = string2) to end of predicate
I am using the bin bin predicatebuilder and have a query working but it is very slow when using .contains, i need it to do exact match instead of contains as it produces faster query when i test both directly on sql server. Ideally i want to be able…

seco
- 1
0
votes
1 answer
PredicateBuilder and LINQ to CRM
I'm trying to pull all the instances of a workflow that have ran (from the AsyncOperationBase table) with a number of predicates.
I know you can't use something like myArray.Contains(x.WorkflowActivationId.Id) so I'm trying to build a predicate…

Francis Ducharme
- 4,848
- 6
- 43
- 81
0
votes
2 answers
Linq PredicateBuilder With Complex AND & OR
Using PredicateBuilder and make a predicate on many ID from a table , we have result of many list with filterd ID like this:
predicate builder make a predicate with OR for {aaa,bbb,ccc,ddd} . i want to have first item of each group. is it possible…

sadeghhp
- 621
- 14
- 28
0
votes
1 answer
Dynamic Linq Build Where Clause many Parameters
I will explain my Problem
so Firstly, I use Predicates Linq for Build Where clause dynamically.
I have to build dynamically because I don't know how many parameters will come. Let me give an example. For the A column can be one parameters however,…

YigitV
- 13
- 2
0
votes
0 answers
Predicate builder Convert.ToInt32 giving error?
In asp.net mvc4 project I am using predicate builder. Here is my code:
public static Expression> AddConditionToQuery( )
{
Guid g = new Guid("d521291f-2edb-4efc-96ac-25a4993bf028");
predicate = predicate.Or(p =>…

Hasan
- 35
- 1
- 3
- 6
0
votes
0 answers
SharePoint Client Object Model and the PredicateBuilder
I am trying to dynamically build a predicate to only hydrate a subset of lists. But I am getting and error.
var predicate = PredicateBuilder.False();
var listTitles = new[] { "List One", "List Two" };
foreach (var listTitle in…

smiggleworth
- 534
- 4
- 16