Using TypedLists as Properties

Posts   
 
    
NickD
User
Posts: 224
Joined: 31-Jan-2005
# Posted on: 02-Feb-2005 17:53:59   

I'm wondering if you all consider it a good idea to add a "GetTypedList" method to the entity class as a property. I work for a school district, and therefore we deal with students and classes. While the generated code created a Student.Registration (the list of classes) collection property, that only returns part of what I want. Since I worked at normalizing my database, I have to join quite a few tables to get things like Teacher name, Period number, Class Title and so on and so forth.

I am considering making a typedList of all the fields that I need and then adding that as a property to my studentEntity. Thoughts?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 02-Feb-2005 22:48:13   

A typed list is a typed class, so can only be created through code generation (either in memory through code dom or through a code generator).

For lists it's indeed sometimes necessary to join a few tables to get the columns you want. Typed lists are there to design these in teh designer, however you can also create them in code using the dynamic list technique, as described in the typedlist/view section of the documentation. These aren't typed, but can help you when you don't want to go into the designer, generate code etc. but just want a list with a few columns from, say 2 or 3 entities.

Frans Bouma | Lead developer LLBLGen Pro