Building LINQ Expressions for ADO.NET Data Services

While the 'LINQ Ninja' moniker is something that Phani completely made up on the spot and I actively reject any such claims, I can still happily recommend reading this blog post which I gave him a hand with.

The thing to remember is that even though writing LINQ queries in C# sometimes makes it look like you're just writing code, behind the scenes the compiler is emitting a bunch of instructions to build an Expression-based representation that mimicks what you just wrote. And of course, if the compiler can do it at run-time, so can you - with a little help of the Expression class.

So even if Astoria doesn't allow you to use an IN clause with a list of constants, you can write code to build a bunch of OR clauses with each constant...

But if you want less talk and more code, head over to https://blogs.msdn.com/phaniraj/archive/2008/07/17/set-based-operations-in-ado-net-data-services.aspx.

Enjoy!