Automatically add filter

Posts   
 
    
Posts: 67
Joined: 10-Jun-2009
# Posted on: 22-Apr-2011 10:33:32   

Scenario: I have a product table, with an optional relation to a translation table which contains the translated product names for a product.

I created a view on both tables, so I can display the product in a grid in a webapplication. If I want to display the right translations, I will filter the view on the column Culture, which contains the culture column.

This scenario repeats itself for numerous times. Not only for the product table, but also for several other tables.

Is there a way to automatically add a PredicateExpression on the Culture column when I want to Fetch data from the view?

I'm using LLBLGen Pro v3.1 and the LLBLGen Runtime Framework

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 22-Apr-2011 11:22:35   

How would the value used in the predicate be added automatically?

I think this is a Business Layer issue. You can have BL methods which perform the fetches and add the required filter. And then all web pages should just call the BL methods which include the pre-canned queries.

Posts: 67
Joined: 10-Jun-2009
# Posted on: 22-Apr-2011 12:01:16   

You're right. I thought it would be nice if I didn't have to add a filter at every call, but it is indeed a business layer issue.

Thanxs