c# - PredicateBuilder ignored in LinqToSQL -


I have found a query for my service sorted in a group of classes. This object defines the conditions in a tree such as Structure support and / oring data up to an infinite depth. I am using LinqToSQL again to change this class to a SQL query, however my conditions (defined by using PredicateBuilder) are ignored!

Predicatebuilder looks like a clear solution, my recursive functions expressions & lt; To support this, IQueryable & lt; Error & gt; Error instead of , Bullet & gt; & Gt; & Lt; Error , I repeat it on the tree repeatedly and appropriately and / or add conditions.

I say the recurring filter as follows, when I can see the recursive function returning filter correctly - my problem is that these conditions are being ignored and output is SQL (please See below), someone can tell why this can happen?

Please tell me whether any additional information is necessary or if you think this approach should work.

  if (harmony) {result Where (recursive handle filter expansion (query criteria)); }  

This is an act that connects predictions

  private expression & lt; Funk & lt; Error, Bullet & gt; & Gt; RecursiveHoldle Filter Expression (filter expression filtering experiments) {// if ending, start with true orders start with false expression & lt; Func & lt; Error, Bullet & gt; & Gt; Predicate; If (filterExpression.FilterOperator == LogicalOperator.And) {predicate = PredicateBuilder.True & lt; Error & gt; (); } Other {predicate = PredicateBuilder.False & lt; Error & gt; (); } // Apply conditions foreach (condition expression in condition.Conditions) {if (filterExpression.FilterOperator == LogicalOperator.And) {predicate.And (application (condition) (condition);} other {predicate.Or (application condition ( Condition));}} // apply child filter foreach (filter expression expression in filterExpression.Filters) {if (filterExpression.FilterOperator == LogicalOperator.And) {predicate.And (RecursiveHandleFilterExpression (expression))}} other {predicate .or (reflexion filter expression (expression));} talk about return;}  

DataContext.Log The generated SQL, logonon column

  SELECT [[source], [T2]. [Exception Message], [T2]. [Inner Express Message], [ T1]. [Information], [T2]. [Log In]] From (Selection [T1]. [Error Idi], [T1]. [Organization ID], [T1]. [Severe] , [T1]. [Source], [T1]. [Exception Message], [T1]. [Details], [T1]. [Logged], [T1]. [ROW_NUMBER] (Select ROW_NUMBER () over (order bye [T] [error id], [t] [Connective id], [t] [Seriousness], [T.] [Source], [T.] [Exception message], [T.] [Innerpexpress message], [t] [Details], [T.]. [Logged in]) [ROW_NUMBER], [T]. [Error id], [t] [Organization ID], [T.]. [Seriousness], [T.] [Source], [T] [Exception Message], [T.] [Innerpexpress message], [t] [Details], [T.]. [Logged in] from [dbo] [Errs] AS [T] WHERE [T.] [Organization ID] = @ P0) AS [T1] WHERE [t1]. [ROW_NUMBER] between @ P1 + 1 and @ P1 + @ P2) AS [T2] ORDER by [T2]. [ROW_NUMBER] - @ p: Input unique identifier (size = -1; Prec = 0; scale = 0) [f311d7f3-3755-e411- 940e-00155d0c0c4b] - @ P1: Input int (size = -1; = 0; scale = 0) [0] - @ P2: Input int (size = - 1; Prec = 0; scale = 0) [51] - Reference: SqlProvider (Sql2008) Model: Attitated Matamodel Build: 4.0.30319.17929  

and and or Methods do not mutate expressions (objects are irreversible.) They return an new expression Those who represent the operation in question. You are ignoring the value of that code in your code.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -