About half year ago we added non-trivial feature to the Camlex: reverse engineering. Details can be found here: Camlex.NET became bidirectional and goes online. Version 3.0 is released. Briefly it allows to parse existing string query into expression tree. Based on this feature we ran online service: http://camlex-online.org where you can paste string CAML query and see how it looks like with Camlex syntax.
When worked over reverse engineering, I thought that there may be many interesting applications. Today I released version 3.2 with another feature built on top of reverse engineering which is closer to applied development. Now you may pass existing string query to the Camlex and add more conditions via lambdas. I.e. you may use Camlex with tools which work with plain CAML queries, expand them using Camlex syntax and pass back to that tool.
Let’s see example. Suppose that we have a CAML query:
it will return list items which have Title = “test”. We need to add another condition: we also want to return those items which have Title = “foo”. Now we can make it like this:
It will produce the following result:
By the same way you may combine conditions via WhereAll method – and in CAML you will get “And” instead of “Or”. Of course you may pass complicated queries and combine several other expressions. Camlex will parse string, create resulting expression tree and returns combined CAML:
By the same way you may expand OrderBy, GroupBy and ViewFields fields:
it will get the following CAML:
This feature came from community and we also glad to hear your proposals on codeplex site. Hope new feature will be useful and will simplify your work.