LLBLGen 4.1 upgrade - FetchEntityCollection

Posts   
 
    
chand
User
Posts: 72
Joined: 05-Aug-2007
# Posted on: 28-Dec-2013 07:02:36   

Before this upgrade FetchEntityColleciton method was overridable, now it is not any more.

What is the alternative for this change?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 28-Dec-2013 07:10:08   

The one with the following signature is virtual:

public virtual void FetchEntityCollection(QueryParameters parameters)

See Migrating your code:

Docs wrote:

In the DataAccessAdapterBase class the following methods have been refactored and now only one overload is virtual instead of all of the overloads. This could break code. Please override the virtual version instead. FetchEntity FetchEntityUsingUniqueConstraint FetchNewEntity FetchEntityCollection DeleteEntity

David Elizondo | LLBLGen Support Team
chand
User
Posts: 72
Joined: 05-Aug-2007
# Posted on: 28-Dec-2013 07:14:42   

What is the equivalent for the following override?

public override void FetchEntityCollection(IEntityCollection2 collectionToFill, IRelationPredicateBucket filterBucket, int maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath2 prefetchPath, ExcludeIncludeFieldsList excludedIncludedFields, int pageNumber, int pageSize)

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 28-Dec-2013 07:28:01   

You cannot longer override that. You need to move your code to this method:

public override void FetchEntityCollection(QueryParameters parameters)
{
     //...
}

All the values you need (IEntityCollectionFetch, PageSize, etc.) are in the parameters variable. So, just move your override code to this, and all should be fine.

David Elizondo | LLBLGen Support Team
chand
User
Posts: 72
Joined: 05-Aug-2007
# Posted on: 28-Dec-2013 08:00:37   

I am not sure this works.

Previous method polymorphically executes our custom code, whenever the fetchentitycollection on base is called.

You won't get the same behavior, unless we modify all the client calls.

This could work if the base class ultimately end up calling the method that take QueryParams.

Is that the case?

chand
User
Posts: 72
Joined: 05-Aug-2007
# Posted on: 28-Dec-2013 08:07:02   

Just checked the calls via reflector. Library code ultimately reaching the overridden method.

i.e I don't need to do any conversion of parameters. In fact it is now simplified.

Thanks!!