tvoss wrote:
Interesting response, since I used linq in vs2008 to solve the problem.
Since Linq to objects works already with llblgenpro, what is v2.6 in general gaining for us?
Thanks,
Terry, you're mixing things.
You typed:
trans.GetScalar(TranFields.Amt, IIf(TranFields.Debit = True, TranFields.Amt, -1 * TranFields.Amt), AggregateFunction.Sum)
here, you use non-linq code, and you specify TranFields.Debit=true. However, TranFields.Debit isn't a value, it's a field. The expression you specified will be compiled (if it compiled) to a delegate, not an expression tree. (as there's no queryable). This means that the delegate isn't usable for database usage, as it's compiled IL.
In v2.6, with Linq and our Linq provider, you can use IIf inside a Linq query. Microsoft made it a bit fuzzy when what is executed with Linq, and you hit that wall as well: a Linq expression only compiles to an expression tree if its source of data is a Queryable (e.g. LinqMetaData.SomeEntity). If it's not, it's just a delegate, and only useable in-memory.