Browse Source

- implemented NOT operator in SQLiteQueryProvider

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5020 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Siegfried Pammer 17 years ago
parent
commit
4ada7017c9
  1. 6
      src/AddIns/Misc/Profiler/Controller/Data/Linq/ExpressionSqlWriter.cs
  2. 10
      src/AddIns/Misc/Profiler/Controller/Data/Linq/SQLiteQueryProvider.cs

6
src/AddIns/Misc/Profiler/Controller/Data/Linq/ExpressionSqlWriter.cs

@ -106,6 +106,12 @@ namespace ICSharpCode.Profiler.Controller.Data.Linq
throw new NotSupportedException(mc.Method.ToString()); throw new NotSupportedException(mc.Method.ToString());
} }
} }
case ExpressionType.Not:
w.Write("(NOT ");
UnaryExpression unary = (UnaryExpression)expression;
w.Write(unary.Operand);
w.Write(")");
break;
default: default:
throw new NotSupportedException(expression.NodeType.ToString()); throw new NotSupportedException(expression.NodeType.ToString());
} }

10
src/AddIns/Misc/Profiler/Controller/Data/Linq/SQLiteQueryProvider.cs

@ -48,6 +48,7 @@ namespace ICSharpCode.Profiler.Controller.Data.Linq
The set of valid expressions is: The set of valid expressions is:
- Integer constants - Integer constants
- Binary operators: < <= > >= == != && || - Binary operators: < <= > >= == != && ||
- Unary operator: !
- value(List<int>).Contains(validExpr) - value(List<int>).Contains(validExpr)
- if c is the lambda parameter, then these expressions are valid: - if c is the lambda parameter, then these expressions are valid:
c.NameMapping.ID c.NameMapping.ID
@ -111,7 +112,7 @@ namespace ICSharpCode.Profiler.Controller.Data.Linq
Because all constructed SELECT queries always select fields with the same meaning in the same order, executing the query is Because all constructed SELECT queries always select fields with the same meaning in the same order, executing the query is
a matter of simply filling the SQLiteCallTreeNodes with the query results. a matter of simply filling the SQLiteCallTreeNodes with the query results.
*/ */
readonly ProfilingDataSQLiteProvider sqliteProvider; readonly ProfilingDataSQLiteProvider sqliteProvider;
internal readonly int startDataSetID; internal readonly int startDataSetID;
@ -307,6 +308,13 @@ namespace ICSharpCode.Profiler.Controller.Data.Linq
else else
return null; return null;
} }
case ExpressionType.Not:
UnaryExpression unary = (UnaryExpression)expr;
Expression imported = Import(unary.Operand);
if (imported != null)
return Expression.Not(imported);
else
return null;
default: default:
return null; return null;
} }

Loading…
Cancel
Save