How to get concrete type of EntityCollection

Posts   
 
    
Behdad
User
Posts: 12
Joined: 08-Jun-2010
# Posted on: 08-Jun-2010 17:37:41   

Hi 1.I have used the following code in winform databinding Dim OrderEntityCollection1 As new EntityCollection Me.OrderEntityCollection1.EntityFactoryToUse = New BusinessLayer.FactoryClasses.OrderEntityFactory

How I can get and iterate OrderEntityCollection's Orders and orderitems in code?are there like two related datatable in a dataset?

  1. When I have an Order how I can get its in-memory OrderItem childs?

Regards

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 09-Jun-2010 05:00:50   

Behdad wrote:

Hi 1.I have used the following code in winform databinding Dim OrderEntityCollection1 As new EntityCollection Me.OrderEntityCollection1.EntityFactoryToUse = New BusinessLayer.FactoryClasses.OrderEntityFactory

How I can get and iterate OrderEntityCollection's Orders and orderitems in code?are there like two related datatable in a dataset?

For Each order As OrderEntity In OrderEntityColelction1
....
End 

(sorry Im not that clever in VB, but entitycollection is a simply enumerable of entities. For more information read Using entity collection classes

Behdad wrote:

  1. When I have an Order how I can get its in-memory OrderItem childs?

Are you using SelfServicing or Adapter? You must use PrefetchPaths if you use Adapter, in SelfServicing that is on-demand but you can use PrefetchPaths as well. (read more).

David Elizondo | LLBLGen Support Team