Missing a Collection?

Posts   
 
    
JustinN avatar
JustinN
User
Posts: 11
Joined: 29-Jun-2008
# Posted on: 06-Jul-2008 23:54:41   

Hey guys,

I am trying to loop through some records, so I did a search, and found that I need to loop through my entity's collection (http://llblgen.com/TinyForum/Messages.aspx?ThreadID=13212&HighLight=1), however I cannot see a collection... I only have the following choices:

VmmVehicleEntity VmmVehicleEntityFactory VmmVehicleFieldIndex VmmVehicleFields VmmVehicleRelations

I am making use of the 2.6 Final ( June 6th 2008 ) Trial Copy.

Does this version no longer make use of Collections, or have I missed out on something?

Regards, Justin

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 07-Jul-2008 05:46:36   

Hi Justin, here it is:

LLBLGenPro wrote:

Adapter contains a general purpose EntityCollection class. This is different from SelfServicing where, per entity definition in a project, LLBLGen Pro will generate an entity collection class. The EntityCollection class is located in the HelperClasses namespace in the database generic project. This class is used to work on more than one entity at the same time and it is used to retrieve more than one entity of the same type from the database. This section describes the different kinds of functionality bundled in the EntityCollection class, related to collection class and how to utilize that functionality in your code.

So, if you are using .NET 1.x:

EntityCollection vehicles = new EntityCollection(new VmmVehicleEntityFactory());
DataAccessAdapter adapter = new DataAccessAdapter();
adapter.FetchEntityCollection(vehicles, null);

foreach(VmmVehicleEntity v in vehicles)
{
      // so something with v
}

And, if you are on .NET 2.0:

EntityCollection<VmmVehicleEntity > customers = 
    new EntityCollection<VmmVehicleEntity >(new VmmVehicleEntityFactory());

DataAccessAdapter adapter = new DataAccessAdapter();
adapter.FetchEntityCollection(vehicles, null);

foreach(VmmVehicleEntity v in vehicles)
{
      // so something with v
}

Don't forget to include the _YourProject.HelperClasses _namespace at _using _section.

Cheers.

David Elizondo | LLBLGen Support Team
JustinN avatar
JustinN
User
Posts: 11
Joined: 29-Jun-2008
# Posted on: 07-Jul-2008 22:02:40   

Thanks again daelmo! I just need to now read up on how to do where clauses and I should be all good to go!

Regards, Justin