Questions tagged [linqkit]

LINQKit is a free set of LINQ extensions, aimed primarily at LINQ to SQL. With LINQKit, developers can: Plug expressions into EntitySets, use expression variables in subqueries, combine expressions (have one expression call another), dynamically build query predicates, and leverage AsExpandable to add new extensions.

142 questions
1
vote
2 answers

howt to Include related entities with filter condition using AsExpandable

I want to include related entities with some filter condition. Is this possible ?? I don't want to write projection query for this. So I was trying to achieve this by below code...... but it's not working. My Domain Object public class UserRef :…
Pankaj Rawat
  • 4,037
  • 6
  • 41
  • 73
1
vote
1 answer

How to use linqkit like

data Name{"divan","dîvan","divân","dîvân" } I want to something like select * from data where Name like % d_v_n % in linq then the expected result would be "divan","dîvan","divân","dîvân" //this linqkit code var searchPredicate =…
Sinan
  • 23
  • 1
  • 5
1
vote
1 answer

LinqPad Predicatebuider Expression call not working

I am trying to get the examples working found at http://www.albahari.com/nutshell/predicatebuilder.aspx I have the following code: public partial class PriceList { public string Name { get; set; } public string Desc…
Tinypond
  • 51
  • 1
  • 8
1
vote
0 answers

how to use predicate into a join statement

I am trying to allow my users to construct their own queries. I found this code which seems to solve this problem: var predicate = PredicateBuilder.True(); if (a != "") predicado = predicado.And(e1 => e1.field1.Contains(a)); if (b!= "") …
David
  • 11
  • 4
1
vote
1 answer

LinqKit Predicates

I am trying to figure out how the Predicates work. I have a piece of code where one parameter will always be supplied but there could be up to 5 different parameters. If I try this way var predicate =…
Luckbox72
  • 147
  • 1
  • 2
  • 16
1
vote
1 answer

Can we use LINQKIT with WCF data services

I could not find any resources online with examples of using LINQKIT with WCF data services. Is it possible ? I tried to do that, but it fails in ExpressionVisitor class in method Visit with error - unhandled expression type 10000. throw new…
user3587767
  • 152
  • 8
1
vote
1 answer

Unable to cast FieldExpression to LambdaExpression

I've written the following function to check an added/modified record for overlapping time periods in the database: Function ClashRecords(Of T)(Query As IQueryable(Of T), Record As T, _ KeySelector As Expression(Of Func(Of T,…
Zev Spitz
  • 13,950
  • 6
  • 64
  • 136
1
vote
1 answer

Linqkit Generic Predicates with VB.NET

I recently came across the wonderful Linqkit library and I want to make use of Generic Predicates to create a function for mapping users to the data they have access too accross any table that contains our data mapping fields. (H1L1, H1L2,…
Shawn K
  • 779
  • 5
  • 13
1
vote
1 answer

LINQKit predicate for code first

I have read this (http://www.albahari.com/nutshell/predicatebuilder.aspx) Here is my code : var predicateOuter = PredicateBuilder.True(); predicateOuter.And(d => d.code== 357); var count=tService.GetCount(predicateOuter.Expand()); my…
john
  • 801
  • 3
  • 10
  • 16
1
vote
1 answer

Predicatebuilder with datetime string comparisson

i just start using linq kit and i think it's awesome but i have a 2 problems i have this collection of items that can be filtered by several conditions a,b,c,d,e(non important) and someDate (datetime) so i have a predicate like this var predicate…
1
vote
2 answers

Dynamically Append LINQ Join

I have a method in my data layer in which I pass in a set of search parameters, dynamically build up the required 'where' clause using the PredicateBuilder class from LINQKit and then execute the LINQ query to return a list of objects. In some cases…
Damon
  • 3,004
  • 7
  • 24
  • 28
1
vote
1 answer

Call linqkit expression in a dynamic linq query

How I can call this LinqKit expression public static Expression> ExpressionOfStatusName { get { Expression> status = (transaction) => …
user1756338
  • 211
  • 2
  • 13
1
vote
1 answer

Dynamic query using LinqKit is so slow! Can a stored procedure be better in that case?

I am using LinqKit to build a query using dynamically generated filters. That query fetches a quite large object graph from the database to perform calculations and does some other modifications to that data. As long as I don't use Includes in my…
user2599447
1
vote
1 answer

issue using Linq Any clause in Predicatebuilder

I am having an issue with the LinqKit predicatebuilder. I have used it in the past for simple queries and it has worked fine but I am now trying to use it with an Any clause in the statement and it seems to be giving me random results. Below is…
Dave Wade
  • 473
  • 1
  • 5
  • 18
1
vote
0 answers

Dynamic LINQ using linqkit

Following this example from http://www.albahari.com/nutshell/predicatebuilder.aspx IQueryable SearchProducts (params string[] keywords) { var predicate = PredicateBuilder.False(); foreach (string keyword in keywords) { …
shai
  • 101
  • 1
  • 14