Overriding GetMulti (or any other ideas)

Posts   
 
    
hylegoz
User
Posts: 10
Joined: 11-Jul-2008
# Posted on: 24-Jul-2008 10:13:53   

Hi,

I wanted to cache a EntityCollection with null predicate and use cached collection from everywhere of program. After this, if any code needs this collection with filter predicate, I will run given predicate in CachedCollection.CreateView or CachedCollection.FindMatches. When I get filtered entities, I will fill those entities on requested entitycollection.

I really need this but I cannot override the GetMulti method on EntityCollectionBase. I can't found any other methods to override that called in GetMulti process.

How can I do this?

Thanks for advice.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 25-Jul-2008 08:49:22   

Hi there,

I would recommend to create a method that wraps the GetMulti call.

public SomeCollection GetAllFiltered(IPredicateExpression filter)
{
     // write the necessary code ... to know if you need to GetMulti or just filter in-memory.
}

That code could be placed in a SomeCollection's partial class or in SomeEntityManager custom class.

David Elizondo | LLBLGen Support Team