fmwviormv / sqlite-net

Automatically exported from code.google.com/p/sqlite-net
0 stars 0 forks source link

Linq support for ! #18

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
.Where(x => !expr) doesn't work, here's a simple amendment for CompileExpr

            else if (expr.NodeType == ExpressionType.Not)
            {
                var unary = (UnaryExpression)expr;
                var text = "not (" + CompileExpr(unary.Operand, queryArgs).CommandText + ")";
                return new CompileResult { CommandText = text };
            }

It didn't help me a lot because somelist.Contains(x.foo) (I hoped it would turn 
into an "foo in (l1, l2, ...)") didn't work either, so I think I'll just switch 
to a regular SQL string, but thought you might want it anyway.

Original issue reported on code.google.com by olau%iol...@gtempaccount.com on 8 Jul 2010 at 6:09

GoogleCodeExporter commented 9 years ago
Getting somelist.Contains(x.foo) to work would save so much pain - most of the 
reason I switch to sql with this is because of the .Contains doesn't work :(

Original comment by codingvi...@googlemail.com on 20 Jul 2010 at 8:42

GoogleCodeExporter commented 9 years ago

Original comment by frank.al...@gmail.com on 14 Nov 2010 at 12:44