tags:

views:

86

answers:

2

Currently I am using Subsonic 2.1 and .NET 2.1 and I have an issue where I am attempting to filter a pre-loaded collection with 300+ items. I am using the following to attempt to preform the filter:

orders = MasterOrders.Where("account", mbrAccount).Load();

The end results is setting orders equal to the entire MasterOrders collection and not the filtered results. Any suggestions?

A: 

If you're targeting Dotnet Framework 3.5 you can use a LINQ select-query. Then convert it to a List<MasterOrder>.

Johan Kronberg
Since I am not using 3.5 are there any other alternatives?
Kamikaze
A: 

You need to use the Filter() method as described in http://stackoverflow.com/questions/1036376/subsonic-filter-in-memory-filter

If you don't seem to have it you might have to update from the repository (or just add the code to your templates). The filter function was an update to the XX_ClassTemplate codegen template.

Mike Walsh