Closed bgilner closed 8 years ago
SqlFu (present or future), doesn't do Linq. All it has are strongly typed sql builders which use expressions. The way you're trying to use it is 'ilegal' because it wasn't meant to be used like that. In SqlFu you're writing Sql either as a string or using a typed builder. But in both cases you should be thinking Sql. Unlike an ORM, in SqlFu Sql abstraction is merely a side effect, not an objective.
ExpressionWriter.HandleParameter doesn't work for an expression such as:
x => ((IFoo)x).Foo ...
This is because the LINQ expresion generates:
{x => (Convert(x).Foo) ...
This fails the condition:
if (node.Expression.NodeType == ExpressionType.Parameter)
since the NodeType is Convert. It therefore generates invalid sql (missing the node.Member.Name)