Injecting a filter in sql expression

Posts   
 
    
IH
User
Posts: 2
Joined: 21-Jan-2010
# Posted on: 21-Jan-2010 16:24:09   

Hello,

I am using 2.6 pro June 6th 2008 build.

I have the adapter type code off the dal project now.

My requirement is along with calling a FetchEntityCollection, I want to include my filter expression (in string) as well.

For example:

original:


service.FetchEntityCollection(customerCollections, filters, prefetchPath)


service.FetchEntityCollection(customerCollections, filters, prefetchPath,"CustomerID > 200")

The "CustomerID > 200" will be a dynamic string coming off database.

I would appreciate any help in this regards.

Thanks

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 21-Jan-2010 21:17:29   

This can be done using the LINQ PredicateBuilder. See the documentation, or search the forums for more information.

The LLBLGen query API does not support this. You would need to parse the string yourself and constuct the required PredicateExpressions dynamically in code.

Matt

IH
User
Posts: 2
Joined: 21-Jan-2010
# Posted on: 22-Jan-2010 10:32:50   

MTrinder wrote:

This can be done using the LINQ PredicateBuilder. See the documentation, or search the forums for more information.

The LLBLGen query API does not support this. You would need to parse the string yourself and constuct the required PredicateExpressions dynamically in code.

Matt

Hi Matt,

Thank you very much for your reply.

Basically I am pretty much new bie in this linq thing, so if you could give me a working sample project or something similar to produce predicateexpressions.

thanks

simon831
User
Posts: 152
Joined: 19-Jan-2006
# Posted on: 22-Jan-2010 12:54:13