FindMatches Alternatives?

Posts   
 
    
njetty
User
Posts: 12
Joined: 22-Nov-2007
# Posted on: 17-Jan-2008 05:15:53   

Hi Guys

Within my application I am having to use the "FindMatches" collection method ALOT. I'm dealing with large collections where there is complex processing on a many many subsets.

My questions....

1) Can you share the internals of "FindMatches"? Is it any more efficient than a simple array iterator? 2) Since FindMatches returns a List<int> the code is not as readable as having the function return something like EntityCollection <EntityType>. Are there any alternatives to FindMatches that might return a strongly typed list like EntityCollection<T>? I could not find any browsing the API. 3) If the answer to 1 is FindMatches does not have any performance benefits over simple array iterator I might try to implement my own version that returns EntityCollectionBase<T>. The problem is I do not see how I could do this since the abstract class EnityCollectionBase is within the LLBLGen namespace so I could not use a partial class to extend it. Is there any other way you can think of doing this? Adding a generic method to EntityCollectionBase<T> or CollectionCore<T>?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 17-Jan-2008 10:19:49   

1) Can you share the internals of "FindMatches"?

The source code is installed on your machine, if you are a licensed customer. You can find FindMatches implementation in: <LLBLGenPro installation folder>/runtimeLibraries/sourceCode/Net2.x/ORMSupportClasses/CollectionCore.cs

Is it any more efficient than a simple array iterator?

It iterates the collection.

2) Since FindMatches returns a List<int> the code is not as readable as having the function return something like EntityCollection <EntityType>. Are there any alternatives to FindMatches that might return a strongly typed list like EntityCollection<T>? I could not find any browsing the API.

Use an EntityView for filtering (which internally uses FindMatches) Please check the LLBLGen Pro v.2.x docs "Using the generated code -> Adapter/SelfServicing -> Using the EntityView2 class"