Can we get an IList from an EntityList?

Posts   
 
    
Josslyn
User
Posts: 2
Joined: 17-Jul-2008
# Posted on: 17-Jul-2008 11:47:42   

We are using 2.6 Demo final .Net 2.0, VS2005 Self Service

I am new user to LLBLGen.

I want to display a list of records that contain 3 foreign keys. We are using an IList for data binding.

When I used an EntityCollection I observed (via SQL profiler) three separate database calls for every item of data displayed in the list. One call to each of the foreign key tables to get the data fields required for the list display. Since we may potentially have a lot of data I would like to avoid this.

I have just built an TypeList that contains all of the fields to display (eg: CountryID, and CountryName through the foriegn key). The join is now done in the initial fetch of data rather than when populating my list.

But how to I get an IList form the TypeList? (with the EntityList there was a GetList() method).

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 17-Jul-2008 12:59:04   

A TypedList is a DataTable and it is perfectly bindable, you don't need to convert it to IList. Otherwise you might need to check this post

Josslyn
User
Posts: 2
Joined: 17-Jul-2008
# Posted on: 18-Jul-2008 03:08:52   

Thanks for that link.

Pulling the IList out of the TypeList worked well.

We are using NVelocity as our view engine. So it is a different kind of binding.