Questions tagged [predicatebuilder]

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

241 questions
0
votes
1 answer

Combine two predicates of different type

I have built a predicate by the Address model (Expression> addressPred). Now i want to combine this with a predicate of the Person model (Expression> personPred). Example of the models are: public class…
0
votes
0 answers

PredicateBuilder producing incorrect SQL statements

So I'm using LINQKIT found here And I'm trying to create an expression on one of my columns, CID. The predicate looks like this: Dim cid As String = "11R" Dim predicate = PredicateBuilder.[New](Of uv_Manifest).And(Function(x) x.CID = cid) And it…
Andrew
  • 720
  • 3
  • 9
  • 34
0
votes
0 answers

overload resolution failed because no accessible 'And' accepts this number of arguments When using Predicatebuilder in Vb.net

I'm Trying to build A dynamic Linq query with predicate builder in vb.net. However, when i try to use the Predicate "And" Clause To filter my query the following error appears. None of the Similar questions here were answered. here is my code: Dim…
charles
  • 55
  • 1
  • 10
0
votes
1 answer

Predicate Building with subquery using LinqKit

I am trying to work out how to build a predicate with a subquery that references the parent query. Example: I have 2 classes (Foo and Bar, of course). The ReferenceId of Bar refers to (in this particular instance) Foo's Id. public class Foo { …
Beakie
  • 1,948
  • 3
  • 20
  • 46
0
votes
1 answer

Error with an EF query with nested predicates - variable of type X referenced from scope but it is not defined

I'm trying to construct an expression that ultimately results in a query like SELECT p.* FROM MyEntity p WHERE EXISTS(SELECT * FROM filters WHERE (filter.type = 1 AND filter.objectid = p.id …
maembe
  • 1,270
  • 1
  • 13
  • 25
0
votes
0 answers

Existing open DataReader using Entity Framework and PredicateBuilder

Ok, I know that this topic has already been discussed in topic 1, topic 2, topic 3 or topic 4 and probably other similar topics, but somehow, I still feel I'm missing something. What I'm trying to do is to create a filter using Entity Framework and…
Ionea
  • 33
  • 1
  • 8
0
votes
1 answer

Hazelcast PredicateBuilder with nested key

I am trying to add an entrylistener to my hazelcast map using a predicate to filter the entries. The method I am calling is: String addEntryListener(MapListener listener, Predicate predicate, boolean includeValue) I am trying to build a…
D. Hill
  • 93
  • 1
  • 10
0
votes
2 answers

LINQ PredicateBuilder not work in my dynamic search

I have a book table in my database and I have book view named vwShared in my edmx. I want to create dynamic search with operators for user to find books. I have 2 SearchColumns dropdownlist contains "Title, Authors, Published Year, Subject". I have…
0
votes
1 answer

PredicateBuilder with DateTime

We've just recently included the PredicateBuilder class in our project and encountered an issue. In the following code, why would the createDateTime condition not included in the generated sql? The other filters are generated properly except for the…
seven21
  • 114
  • 1
  • 8
0
votes
2 answers

Linq: dynamic Where clause inside a nested subquery get latest records of each group

I currently get problem to dynamic linq expression below My Models public class Orders { public int OrderId ; public ICollection Statuses; } public class Statuses { public int StatusId; public int OrderId; …
0
votes
0 answers

LINQ PredicateBuilder - List Contains

I am trying to build up a predicate which will filter my data. I have a List and I need get all data where the ID matches the data in the list. Can I do this? Currently I have it working like so: Expression
Andrew Kilburn
  • 2,251
  • 6
  • 33
  • 65
0
votes
1 answer

Predicate Builder Issue

Imagine I have 2 database tables.. 1 table holds different sports: |ID| |Sport| 1 Baseball 2 Basketball 3 Soccer The second table holds the ID of the Sports table, so a foreign key Name of Table - TestDB |ID| |SportsID| …
Grizzly
  • 5,873
  • 8
  • 56
  • 109
0
votes
1 answer

An unhandled exception of type 'System.StackOverflowException' occurred in EntityFramework dll

I get this exception when I try to process 270k records. It fails at 12k. Can someone explain to me what I am missing? The database is SQL and I am using EF 6. I am using predicate builder to build my where clause. The idea being select * from table…
Deepak
  • 126
  • 1
  • 11
0
votes
0 answers

Predicate builder not working

I'm not exactly sure why this code wont compile. Any help would be greatly appreciated. I'm trying to follow this SO thread List ageRanges = new List(); List people = new List(); protected void Page_Load(object…
aberhamm
  • 13
  • 2
  • 3
0
votes
2 answers

Scope of Collections used in LINQ Predicates

I really like PredicateBuilder. It allows me to build all sorts of queries very dynamically. The predicate variable can be passed around to different objects and they can add onto it with values they know about, etc. Except when I am needing to use…
sliderhouserules
  • 3,415
  • 24
  • 32