I'm trying to work out a solution, where at runtime a procedure would parse a "string" and return a predicate. so far what I've found is DynamicLinq class (sample) that does the job.
I'm wondering - is it possible to use OData lib to the same ? Pass in the "odata" structure string ("?color='red'¶m=foo"), and get a Linq predicate ?
The ODataLib contrib project includes a parser similar to what you're looking for. It's doesn't produce the LINQ predicate yet, it only produces intermediate AST, but it might give you something to start from. See http://odata.codeplex.com/wikipage?title=ODataLib&referringTitle=Home (the library is available as a source code on the codeplex or as a nuget package http://nuget.org/packages/Microsoft.Data.OData.Contrib)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With