Questions tagged [predicatebuilder]

Allows you to dynamically composing expression predicates to be used in WHERE clauses in LINQ and also in EntityFramework.

232 questions
54
votes
2 answers

C# PredicateBuilder Entities: The parameter 'f' was not bound in the specified LINQ to Entities query expression

I needed to build a dynamic filter and I wanted to keep using entities. Because of this reason I wanted to use the PredicateBuilder from albahari. I created the following code: var invoerDatums = PredicateBuilder.True(); var inner…
Neothor
  • 743
  • 1
  • 5
  • 10
35
votes
1 answer

How does PredicateBuilder work

C# in a Nutshell has a free class called PredicateBuilder which constructs LINQ predicates piece by piece available here. Here's an extract of the method which adds a new expression to the predicate. Could someone explain it? (I have seen this…
just.another.programmer
  • 7,909
  • 8
  • 42
  • 83
15
votes
1 answer

Graphical Predicate Builder in Xcode 4 with Core Data

I am using Xcode 4, and I can't find a way to work with the graphical predicate builder. Is it still there? How do I use it? Where is the documentation on this? Thanks
Jim
  • 5,844
  • 9
  • 41
  • 87
14
votes
2 answers

Difference between PredicateBuilder and PredicateBuilder?

I have the code: var predicate = PredicateBuilder.True(); predicate = predicate.And(x => x.value1 == "1"); predicate = predicate.And(x => x.value2 == "2"); var vals = Value.AsExpandable().Where(predicate).ToList(); If I have…
Xaisoft
  • 42,877
  • 83
  • 270
  • 415
11
votes
1 answer

(Compound) Predicate Builder in Xcode 4 -- Where is it?

First off, this question is closely related to Graphical Predicate Builder in Xcode 4 With Core Data. However, I don't have a high enough rating to comment yet, and since I have no answer to offer, I'm asking a new question with much more specific…
Murdock
  • 816
  • 9
  • 21
10
votes
3 answers

How to create predicate dynamically

Hi i want to create a list based on the search string using predicate expressions. I have a list of type products contains different names. List list1 = new List(); list1.Add(new products("sowmya")); …
Sowmya
  • 307
  • 1
  • 5
  • 16
9
votes
2 answers

LINQ to SQL PredicateBuilder

Im using the PredicateBuilder as seen here http://www.albahari.com/nutshell/predicatebuilder.aspx, everything works great, and now i can genrate Dynamic LINQ to SQL expressions, but the thing that i dont understand is why when i am on a loop like…
JOBG
  • 4,364
  • 4
  • 23
  • 47
7
votes
1 answer

Sitecore Search Predicate Builder multiple keyword search with boosting not working as desired

I have sitecore pages / lucene documents with the following fields: Title Filename Content File Contents I'm creating a search for these and have the following requirements: Hits containing the whole phrase in the title field should be returned…
David Masters
  • 7,556
  • 1
  • 37
  • 65
6
votes
1 answer

PredicateBuilder cannot convert to IQueryable?

i have a function: private IEnumerable MatchesKeyword(IEnumerable list, String keyword) { ...snip... } which right now performs a LINQ query: private IEnumerable MatchesKeyword(IEnumerable list, String…
Ian Boyd
  • 220,884
  • 228
  • 805
  • 1,125
6
votes
4 answers

C# Predicate Builder with "NOT IN" functionality

With PredicateBuilder how do I get functionality similar to the SQL IN or NOT IN query? For example I have a list of IDs and I want to select all of the People whose IDs either Match or do not match the IDs. The people match functionality is fairly…
Craig G.
  • 137
  • 1
  • 9
6
votes
1 answer

Can PredicateBuilder generate predicates that span multiple tables?

I would like to dynamically generate predicates that span multiple tables across a Join in a Linq statement. In the following code snippet, I want to use PredicateBuilder or a similar construct to replace the 'where' statement in the following…
EulerOperator
  • 121
  • 2
  • 4
6
votes
1 answer

LinqKit and async in Entity Framework

I am getting the following error when using the predicate builder with Entity Framework Core. The source IQueryable doesn't implement IAsyncEnumerable. Only sources that implement IAsyncEnumerable can be used for Entity Framework asynchronous…
Bryan
  • 4,239
  • 4
  • 44
  • 62
6
votes
4 answers

Why multiple filters are applied even if query recreated on each iteration

I found this code below in a file called Filter.cs in a project created with Microsoft App Studio. Although I am a veteran C# programmer, I'm short on experience with LINQ predicate expression builders. I can tell that the code below it is…
Robert Oschler
  • 13,520
  • 17
  • 74
  • 209
6
votes
1 answer

Reusable predicate expressions in LINQ to Entities queries

A certain set of criteria that occurs in many different queries throughout our application has slowly grown more complex. To avoid duplication of this code, I want to split these criteria out into a method that returns the conditions as an…
bernhof
  • 5,936
  • 2
  • 40
  • 66
6
votes
2 answers

LinqKit PredicateBuilder returns all or non rows

I'm beginning to use LinqKit's PredicateBuilder to create predicate's with OR conditions which is not possible with Linq expressions. The problem I'm facing is if I begin with PredicateBuilder.True() it returns all rows and if I begin with…
Ashkan
  • 3,182
  • 4
  • 34
  • 45
1
2 3
15 16