Questions tagged [predicatebuilder]

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

241 questions
1
vote
2 answers

Hazelcast Predicate/SqlPredicate on Map of HashMap

I have a Hazelcast Map of HashMap as values as I have shown below. HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig); IMap> imap = client.getMap("users"); HashMap value = new…
NPS
  • 93
  • 2
  • 7
1
vote
1 answer

Dynamically build a predicate for a nullable enum

I'm trying to build a search predicate dynamically but I'm having a little issue with nullable enums in my class. This is my class and enum structure: public class TestNullableEnumClass { public TestingEnum? TestEn { get; set; } } public enum…
Sun
  • 4,458
  • 14
  • 66
  • 108
1
vote
1 answer

Manuel Expression Builder contains doesnt work because of null value in list

var people = new[] { new myUserListObject { userobj = new User { Email = "test@gmail.com"},Session=3 }, new myUserListObject { userobj= new User { Email = null }, Session=4} }; var peopList =…
TnasuH
  • 25
  • 6
1
vote
1 answer

Building a Linq to EF query to a variable list of keywords in a variable number of columns?

I am trying to come up with a utility method to build a Linq Query or Linq Predicate to add to an Linq to EF query to do search for all terms in a list of terms in a variable number of columns. I am trying to use PredicateBuilder to build the where…
John S
  • 7,909
  • 21
  • 77
  • 145
1
vote
3 answers

C# Predicate Builder not working

I am trying to use predicate builder in the following code: public ListResults GetAccountDetail(string[] salesForceKey) { try { using (var c = new SalesForceDataContext()) { …
1
vote
1 answer

Trying to join tables with predicate builder

I have two tables that I want to join using predicate builder. In pseudo code, I want to return all StudentSchedule rows, joining with Student on StudentId, where StudentLastName = "Smith". public class Student { int StudentId {get;set;} …
Amanda_Panda
  • 1,156
  • 4
  • 26
  • 68
1
vote
2 answers

Using PredicateBuilder to build query searching across multiple columns of Entity

I have a list of field names. I am trying to build a predicate to look in the fields to see if they contain the search term. I have gone done the path listed in this original question but do not understand how to do a Contains instead of a…
John S
  • 7,909
  • 21
  • 77
  • 145
1
vote
2 answers

LINQ to SQL - PredicateBuilder

Quick question on how to get even more out of PredicateBuilder. It works as per below: IQueryable SearchProducts (params string[] keywords) { var predicate = PredicateBuilder.False(); foreach (string keyword in keywords) { …
qnr
  • 11
  • 1
  • 2
1
vote
1 answer

How can I build a LINQ predicate/dynamic.LINQ query based off grid filtering when the grid properties don't have the entity properties?

I have a grid passing me filters. So I may have an object like: var filter = new Filter(){ Member = "Titles", Operator = Filter.Operators.IsEqualTo, Value = "Developer" }; Then I need to take this and extend an IQueryable so to do that, I…
SventoryMang
  • 10,275
  • 15
  • 70
  • 113
1
vote
2 answers

Concatenate string members using Linq PredicateBuilder for text search

I have a REST WebAPI using EntityFramework database first. All code is generated off the EDMX file, entities, repository classes and API controllers etc. I have added some filtering functionality which allows users to add conditions via the query…
pstep
  • 13
  • 6
1
vote
0 answers

Dynamically Building a nested Predicate

I am trying to dynamically build predicates, from an xml string which is formatted as the following as an example: (ContainsValue)
Naz Ekin
  • 347
  • 6
  • 17
1
vote
3 answers

How do I dynamically construct a predicate method from an expression tree?

Here's the scenario: Silverlight 4.0, DataGrid, PagedCollectionView itemssource. The objective is to apply a Filter to the PCV. The filter needs to be a Predicate(Method) - where Method implements some logic against the object and returns…
tobewan
  • 189
  • 2
  • 9
1
vote
0 answers

How can I combine PredicateBuilder predicates?

Is there a way of combining two predicates even though they are from different tables. The sql equivalent will be retrieving the results through an inner join. Albahiri documentation display nested predicates which isnt what im looking for as thats…
TheAkhemist
  • 219
  • 1
  • 14
1
vote
1 answer

Weird SQL using Entity Framework

I have an application with Entity Framework and SQL Server running in production and I am running the SQL Server Profiler to identify slow SQLs to optimize the application. I have a complex scenario with N possibilities of filtering choices, so I…
1
vote
1 answer

Fluent, NHibernate, and PredicateBuilder

Fluent v1.4, NHibernate v4.0.2.4000, SQL Server I've seen some posts where Predicate Builder with nested Lambda expressions are not evaluated in NHibernate v3. Could it be that v4 also has this problem? Public Function TestingWorldQuery() As…
D. Kermott
  • 1,613
  • 17
  • 24