Return entitycollection as Myxxx

Posts   
 
    
bunzee
User
Posts: 84
Joined: 20-Mar-2007
# Posted on: 05-Jul-2012 19:03:12   

Llblgen 2.5 dotnet 3.5

I have the DAL generate as 2classes adapter. MyOrder and MyOrderDetail.
I have a function: foo(EntityCollection<MyOrderDetail> orderdetails) I have a caller function which does this: foo(myorder.OrderDetail);

Problem myorder.OrderDetail returns EntityCollection<OrderDetail> so I have error and casting (EntityCollection<MyOrderDetail>)myorder.OrderDetail does not work.

Question: How can I get EntityCollection<MyOrderDetail> fro MyOrder.OrderDetail?

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 05-Jul-2012 19:24:33   

Use EntityCollection<OrderEntity> in the method signature, and make sure the collection passed is using the MyOrderEntityFactory, so that entities get instantiatred from the sub-Type.

The following thread might shed some light: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=13813