Filtering

Posts   
 
    
cloude1080
User
Posts: 4
Joined: 24-Jan-2007
# Posted on: 24-Jan-2007 15:15:12   

Hi,

I am having a few trouble with filtering. I have 2 tables:

Department that contains EmployeeID and Employee that contains EmloyeeID and Name. Both collections are data binded to numerous of views. Now I want to filter EmployeeCollection through Department.

I know that I can do it by using filter and SetOperation.In. Trouble is, I have to call EmployeeCollection.GetMulti(filter) and bind the new collection back to the views, which is not ideal. cry Is there a way to keep the old collection and just hide the filtered out values away from the views. confused

By the way, I am using LLBLGen ver 2.0 trial.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 24-Jan-2007 15:44:12   

Use memroy filtering through EntityViews and databind to the newly filtered EntityViews.

Please refer to LLBLGen Pro manual: "Using the generated code -> SelfServicing -> Using the EntityView class"

cloude1080
User
Posts: 4
Joined: 24-Jan-2007
# Posted on: 26-Jan-2007 11:30:31   

Hi, Walaa.

The in-memory EntityView unfortunately does not support the filter FieldCompareSetPredicate which we must use in our situation.

At the moment , the filter looks like this

filter.Add( new FieldCompareSetPredicate( EmployeeFields.DepartmentId, DepartmentFields.DepartmentId, SetOperator.In, (DepartmentFields.Path == path) ) );

If there is any other way to work around this, please enlight me.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 28-Jan-2007 09:33:52   

At the moment the view filtering is just 1 level deep (i.e. the view), not multiple levels deep, so the set filter isn't usable in memory. We'll investigate to add this in the future.

Frans Bouma | Lead developer LLBLGen Pro