Prefetching related items of inherited entities

Posts   
 
    
wtijsma
User
Posts: 252
Joined: 18-Apr-2006
# Posted on: 22-Jul-2008 13:35:01   

Hi,

Is it possible to prefetch collections mapped on fields of inherited entities (in case it is of the inherited type) with something similar to a cast?

I imagine it would look something like to this:

IQueryable<BaseEntity> baseEntities = 
  linqMeta.Base
   .WithPath( pf => pf
      .Prefetch<BaseRelatedEntity>(baseEntity => baseEntity.BaseRelatedEntities)
      .Prefetch<InheritedRelatedEntity>(inheritedEntity => ((InheritedEntity)inheritedEntity).InheritedRelatedEntities)
  )


Any ideas?

Thank you in advance,

Wiebe Tijsma

wtijsma
User
Posts: 252
Joined: 18-Apr-2006
# Posted on: 22-Jul-2008 14:18:09   

I think I've found my answer here flushed

Lambda Prefetch - Inheritance http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=12983&HighLight=1